private void CmsTextSelect_Open(MouseEventArgs e, TextBox Tb) { if (Tb.SelectionLength > 0 && e.Button == MouseButtons.Left) { TB = Tb; CmsTextSelect.Show(Cursor.Position); } }
private void CmsTextSelect_Open(MouseEventArgs e, object Obj) { if (e.Button == MouseButtons.Left) { switch (Obj) { case TextBox tb when tb.SelectionLength > 0: case RichTextBox rtb when rtb.SelectionLength > 0: OBJ = Obj; CmsTextSelect.Show(Cursor.Position); break; default: OBJ = null; break; } } }