General information
Category:
Coding, syntax & commands
Environment versions
Network:
Windows 2003 Server
I think MessageBox being called from modal forms is what's causing all our "Modal form loses focus" problems.
All our apps use modal forms, and we tend to have problems after "form1" calls "form2" which calls "form3" then using MessageBox in Form3's click method (which may call some other core code to do stuff). This completes OK but sometimes form3 loses focus to form2 - form3 should be still visible as not released yet and have focus, yet form2 becomes visible and buttons press but do nothing, and moving the form around shows "form3" beneath it. I'm betting MessageBox has a lot to do with this problem...
Please don't bother lecturing me about the virtues of modeless apps - been there, done that, and it's not the issue.
Heck, I bet if I replaced MessageBox with our own version (which I really don't want to have to do) the problem would go away. Alternatively could create a better application object that forms ply with a list of forms called so that the correct form retains focus. However, this shouldn't be necessary and having to work around something as useful as Messagebox is a right pain.
Just my twopence worth.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only