Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good afternoon guys, how was your weekend? Please i have a little challenge and need help. i'm working on a Windows application with an MDI Parent Form and added other windows form that the user can interact with.What i need is;once your are working with the other windows form, you will not be able to perform any operation on the parent form until you close the other windows form or when you are through with the operation you are doing on it. Looking forward to your reply.
Posted
Comments
Аslam Iqbal 21-Mar-11 7:34am    
Are other forms child form?

Hi SIMOKOOL,

You can use the function :

Child_Form.ShowDialog();


when showing your new Child form but not using it as a MDI Child.

I hope this help,
:)
 
Share this answer
 
v2
Comments
Toniyo Jackson 21-Mar-11 7:17am    
Correct Answer. +5
Аslam Iqbal 21-Mar-11 7:35am    
If you call this then the following error will arise:
"Form that is not a top-level form cannot be displayed as a modal dialog box. Remove the form from any parent form before calling showDialog."

You can't call showDialog while the form is child of the maim MDI form.
Dalek Dave 21-Mar-11 8:53am    
That'll work!
The "parent" form in a MDI app is always accessible. To prove it, click the menu in the main form of your app. The parent form in a MDI app doesn't have any funcitonality other than a menu, toolbar, and/or status bar.

It looks to me like you're not all that familiar with how MDI applications work. Either that, or I don't understand your question.
 
Share this answer
 
You can have static property on this other form that tells other ;) forms that it is open and event to notify the rest that the property has been changed.

Just a quick thought
 
Share this answer
 
Comments
fjdiewornncalwe 21-Mar-11 9:00am    
You're trying to manually manage the "ShowDialog" functionality that already exists. You may be wandering away from expected behavior doing it this way.

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