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.EventArg s e)
{
Object oControlType =
System.Windows. Forms.Form.Acti veForm.ActiveCo ntrol.GetType() ;
if (oControlType.T oString() == "System.Windows .Forms.TextBox" )
{
oActiveControl = System.Windows. Forms.Form.Acti veForm.ActiveCo ntrol;
if(oActiveContr ol.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