for detect that which controls is activated in windows form
this.ActiveControl = NameOfControl;
how about detect type of control , for example active control is button or textbox ?
New Edit:
i want to do something on keypress if active control is type of textBox else do nothing
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (this.ActiveControl == xxxx)
{
//do SomeThing
}
return base.ProcessCmdKey(ref msg, keyData);
}
in xxx i should type of name of control , but how can i do for all control that is type of text box?