|
-
Apr 3rd, 2006, 02:19 AM
#1
Thread Starter
Lively Member
[RESOLVED] MDI Child Problem
Dear Friends,
Now I want to make a form child of another form that is mdiContainer.How can I do that?
Rajib
Last edited by Hack; Apr 3rd, 2006 at 06:54 AM.
Reason: Added [RESOLVED] to thread title and green "resolved" checkmark
Please Rate every reply if it is useful to u
-
Apr 3rd, 2006, 02:46 AM
#2
Re: MDI Child Problem
If Form1 is the MDI Parent then set the isMDIContainer property of the Form to True. Now if Form2 will act as a MDIChild, then you can use this code
Code:
Form2 newForm = new Form2();
newForm.MdiParent = this;
newForm.Show();
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Apr 3rd, 2006, 03:48 AM
#3
Thread Starter
Lively Member
Re: MDI Child Problem
Dear Shuja,
Thanks for quick response. But I want that if child is open then parent must be inactive. here when the child is open the total application can be closed by clicking on close button of parent. But don't want that. i want that user must close child before close total application.
Can anybody help me ?
Rajib
Please Rate every reply if it is useful to u
-
Apr 3rd, 2006, 03:59 AM
#4
Re: MDI Child Problem
What's the difference between closing the child and then the parent or just closing the parent? When you close the parent it raises an event in the child so you can prompt the user then to save any pending changes or whatever. If you really want to prevent the user closing the parent then you're going to have to handle that situation in the parent. Strictly speaking you should disable all the means of closing the parent, like menus, toolbars, titlebar, etc. Alternatively you could just handle the Closing (2003) or FormClosing (2005) event and cancel it if the child is open, but that is less professional. I really can't see a reason to prevent the parent closing though. I've never seen an app that does that. usually they just do as I suggested and prompt the user to save any pending changes before closing.
-
Apr 3rd, 2006, 05:10 AM
#5
Thread Starter
Lively Member
Re: MDI Child Problem
Thanks for ur valuable suggetion. I was just confused. But u realy make me free. Thanks again.
Rajib
Please Rate every reply if it is useful to u
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|