Solved

Set mdi Parent

Posted on 2006-07-03
5
421 Views
Last Modified: 2008-02-01
Hi,

Where and how do I set the mdi Parent for any form I add to my project.

thanks in advance

Andrew
0
Comment
Question by:REA_ANDREW
  • 3
5 Comments
 
LVL 12

Expert Comment

by:gbzhhu
ID: 17031173
use the IsMDIContainer property and set it to true
0
 
LVL 20

Author Comment

by:REA_ANDREW
ID: 17031207
hi, thanks for that. What I am looking for though.

I have set My Parent form to be the mdiContainer, but I do not know how to give it children. How do I code the following.

Setting a form to be an MdiChild
Activating a child to appear inside the parent.

Thanks in advance

Andrew
0
 
LVL 12

Expert Comment

by:gbzhhu
ID: 17031263
<childform>.Parent = <parentform>;

where childform is the form you want to be child form and parentform being the parent form
0
 
LVL 3

Accepted Solution

by:
Bowmanje earned 250 total points
ID: 17031267
You need to set the MdiParent property, and then use the .Show() method...

Form frmchild=new Form();
frmchild.MdiParent=this;
frmchild.Show();

Another relevant property is the ActiveMdiChild property of the parent.  It will allow you to determine which child has focus.

HTH,
-Josh
0
 
LVL 12

Assisted Solution

by:gbzhhu
gbzhhu earned 250 total points
ID: 17031269
Look here for quick example

http://www.c-sharpcorner.com/winforms/MDIformssampPSD.asp

Loads of samples on the web, just type mdi c# in google
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now