You can do that by looking in the ActiveControl property of the form. It contains the control that has the focus. Check if the type is one of the container controls (panel, groupbox or tab) if it is then also look at its active control property or traverse all of its contained controls to see if what control has focus...
find out in MDI-Form which Control has the focus
lela_dd
thanks for your answer; i guessed that i have to traverse so as you described. Isnt there a easier way
bye
NiroViji
Aside from the ActiveControl property, I am not aware of an easier way to do this.
cheers,
Paul June A. Domag
tk18
You can do that by looking in the ActiveControl property of the form. It contains the control that has the focus. Check if the type is one of the container controls (panel, groupbox or tab) if it is then also look at its active control property or traverse all of its contained controls to see if what control has focus...
cheers,
Paul June A. Domag
DanielSilva
private
Control GetActiveControl() {Form f = this.ActiveMdiChild;
if( f != null ) {
return f.ActiveControl; // This could be null.
}
}
ZnZn