i want to allow my "Cut" command to dynamically determine the active control
and cut any selected text from it (assuming it's a textBox control). so far
i've got this:
private void menuItem5_Click(object sender, System.EventArgs e)
{
Object oControlType =
System.Windows.Forms.Form.ActiveForm.ActiveControl .GetType();
if (oControlType.ToString() == "System.Windows.Forms.TextBox")
{
oActiveControl = System.Windows.Forms.Form.ActiveForm.ActiveControl ;
if(oActiveControl.SelectedText != "")
{
oActiveControl.Cut();
}
}
}
i want to set oActiveControl to the active textBox and cut any text, but
this doesn't work. is there a way to pull this off or do i have to first
determine exactly which textBox is active and then cut from there?
tks