• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 429
  • Last Modified:

Set mdi Parent

Hi,

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

thanks in advance

Andrew
0
REA_ANDREW
Asked:
REA_ANDREW
  • 3
2 Solutions
 
gbzhhuCommented:
use the IsMDIContainer property and set it to true
0
 
REA_ANDREWAuthor Commented:
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
 
gbzhhuCommented:
<childform>.Parent = <parentform>;

where childform is the form you want to be child form and parentform being the parent form
0
 
BowmanjeCommented:
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
 
gbzhhuCommented:
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

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now