I have two open winforms, say that winform1 gets a modal dialog, this means that all forms(winform1 and winform2) will be “disabled”. If we minimize all forms and then bring up winform1, then the modal dialog will be shown above it. If we again minimize all the forms but this time brings up winform2, it will look like the finform2 is ready to be used while its really disabled like winform1.
What I need is to clearly show that the modal dialog needs to be handled before using winform2 again.
Is there anything built in to handle this or am I on my own here?
In your
winform2.Activatedevent handler, call this:e.g.
You may need to do the same thing for
winform1‘sActivatedevent. It depends howwinform2gets created. Just try it and if you find thatwinform1(or any other nonmodal form) is still able to get in front of the modal form, just callFocusModalForm()from itsActivatedevent.I tried this in Windows 7. I tried hiding all windows (click the Show Desktop button on the taskbar) and then selecting form2 directly from the taskbar, and I also tried just selecting form2 from the taskbar without hiding all windows. Form3 always stayed on top.