I’m trying to find out what forms blocks the parent modaly.
My Environment is a bit complex. I got an AppToolBar (like the Taskbar) which is the main form of the application. All Forms opend by my own toolbar are therefore
ShowInTaskbar = False
because there are shown in my own toolbar. Also all Forms opend by the application directly (via the AppToolBar) are stored in a List. Lets assume I have Form1, Form2 and Form3. Form1 and Form2 are directly opend by the AppToolBar, Form3 is created by Form1 and then shown by
Form3.ShowDialog(Form1)
At some point the user minimizes my whole application which then calls
Form1.Hide
Form2.Hide
I can’t set the state of Form1 to minimized, as it would appear as a minimized window above the Taskbar because it isn’t shown in the taskbar. Now Form1 should call Form3.Hide. So how can I find out, that Form3 blocks Form1 from the Form1 point of view?
Cheers.
Just for the sake of having this question marked answered and Hans not posting his solution, I will.
You’ll get all open forms by calling
which will give you back all Forms. To find out which form blocks Form1, you simply have to search for the Owner Property in all open Forms and return those forms where the Owner is Form1.