Focus issue with modeless form

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
 
M

Michael Wong

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

What to do?
 
M

Michael Wong

For those interested, this is a work around:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top