public GuiConsoleForm(string caption, string cmdPrompt, StringHandler h) { Text = caption; prompt = cmdPrompt; stringHandler = h; textBox = new ConsoleTextBox(this); textBox.Dock = DockStyle.Fill; textBox.Font = new Font("Tahoma", 10, FontStyle.Bold); textBox.WordWrap = false; Width = 750; Size = new Size(467, 400); timer.Interval = 50; timer.Tick += new EventHandler(Execute); this.Controls.Add(textBox); // quick interaction with code, including realtime right mouse drag textBox.MouseDown += Images.Form1.TMouseDownCode; textBox.MouseMove += Images.Form1.TMouseMoveCode; // get changes on screen textBox.MouseMove += (s, e) => { if (e.Button == MouseButtons.Right) { textBox.ExecuteSelectionLine(true); } }; // and executed textBox.DoubleClick += (s, e) => textBox.ExecuteSelectionLine(false); }