Click here to Skip to main content
15,888,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The usual behavior of .Show and .ShowDialog is clear...
But now I have an application where some Forms open sub dialogs and shall be blocked by them (.ShowDialog), while ONE specific form always needs to be accessible.
So new opened forms shall block all the others "under" it (same owner/caller, or a line of callers). But one form, that opens in the beginning parallel to the main form, shall be free from the others...

I hope this was clear enough ;), otherwise please ask for details.

What I have tried:

Application.Run a second time for the accessible form.
setting specific owners, which didn't have any effect. Weirdly, all documentation claim so: ~"the owner will be blocked"...
Posted
Updated 14-Jun-16 4:04am

1 solution

There is no standard way to do this: when you call ShowDialog it displays as an Application Modal dialog - which means that you cannot access any other forms from the current application until the dialog has been dismissed.
You can't use Show and ShowDialog to have a modal form and a "spare" form both usable within the same application at the same time.
In order to do what you want, you can't use ShowDialog at all, and will have to emulate the modal effect in all other windows while it is open by forcing the focus back to the "modal" form when the user attempts to select them.

The other solution is to open the "always usable" form in the modal dialog (remembering to close it before calling ShowDialog).

Nasty piece design from a user point of view either way...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900