Focus issue with modeless form

  • Thread starter Thread starter Michael Wong
  • Start date Start date
M

Michael Wong

Hi,

Normally, when I close a MessageBox (called from the menu About), on the
main form that has a textbox that is previously focused and has some
text selected, the focus comes back to that textbox (same selected text).

But if the form, is a popup (modeless), showed from the main form, the
focus doesn't come back correctly to the textbox. I have to activate
other window, and come back to that popup form, to see the selected text
again.

Hope that my explaination is clear.

Anyone has a solution for this?

I am using Windows XP with .NET 1.1

Thanks
 
Apparently, the focus went back to the popup form which doesn't give
back the focus to the last focused control.

What to do?
 
For those interested, this is a work around:

Control ctrl = ActiveControl;
.... MessageBox.Show(...)
ctrl.Focus();
 
Back
Top