Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create multiple window inside c# form

Status
Not open for further replies.

jonathanlimcy

Programmer
Apr 2, 2008
7
TW
I am new to c#. Currently i would like to create multiple windows in C# that can be cascaded or tiled together in my c# form. What i mean is just like opening multiple word document in microsoft window. Is that possible to be done in c sharp. By the way, what object name is this function? Hope i am clear. Thanks.
 
Set the IsMdiContainer property of your main form to True.



Hope this helps.

[vampire][bat]
 
Sorry, I posted too quickly.

Then each time you create a new child form set its

MdiParent property to this (in other words to the main form.)

[vampire][bat]
 
Hey earthandfire,

Thanks a lot. Appreciate the help as it save my time.
 
As a side note, if this is a new project you can start a new MDI Project and have Visual Studio create a good template for you, including the menu's and buttons to cascade and arrange the windows.
 
Now i have 3 forms, form1, form2 and form3. Form1 is my parent form. Form2 and form3 are child form. Form3 is loaded when i press a button in form2. But i cannot use the load form function of

Form3 newMDIChild = new Form3();
// Set the Parent Form of the Child window.
newMDIChild.MdiParent = this;
// Display the new form.
newMDIChild.Show();

because Mdiparent is form1 and not form2. How can i rewrite this? THank.s
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top