private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { ToolStripMenuItem tsmi = (ToolStripMenuItem)sender; ContextMenuStrip cms = (ContextMenuStrip)tsmi.Owner; //DataBindings db = TDBG_elm.DataBindings[0]; myTextBox mtb = (myTextBox)cms.SourceControl; dt.Rows[ra[mtb.Number]].Delete(); dt2dic(); }
private myTextBox GetWebControl() { myTextBox control = new myTextBox(); control.Font = new Font("Tahoma", 12); control.ReadOnly = true; control.BorderStyle = BorderStyle.None; control.WordWrap = true; control.Click += new EventHandler(webcontrol_Click); control.ContextMenuStrip = CMS_TB; return(control); }
void webcontrol_Click(object sender, EventArgs e) { myTextBox mtb = (myTextBox)sender; SetHighlights(mtb.Number); if (mtb.Connected != -1) { A[mtb.Connected].Disconnect(); mtb.Disconnect(); } else { ConnectIfPossible(mtb.Number); } Score(); }