how to make 2 form show in 1 form

shingo99

Freshman
Joined
Jul 19, 2004
Messages
31
hi
i wish to make 2 form show up together in 1 form
some say us MDi form
but how to get that?and how to set those 2 form to show up?
can help me please?
thank you in advance
 
Hmmm...

shingo99 said:
hi
i wish to make 2 form show up together in 1 form
some say us MDi form
but how to get that?and how to set those 2 form to show up?
can help me please?
thank you in advance

This is an interesting question. Since you posted your question I have tried the normal way of adding Form2 to Form1 directly or onto a panel or other control. Every time when I run Form1 I get the following error:

An unhandled exception of type 'System.ArgumentException' occurred in system.windows.forms.dll

Additional information: Cannot add a top level control to a control.

I will now investigate the MDI form that you mention. Questions like these are the best way that I learn the ins and outs of .NET. :)
 
The answer is pretty easy...

The forms hava a hidden (from intellissence) property called: TopLevel.
Set this property to False and there you are... you can maniputate a Form like any other control... easy...

Alex :p
 
To make a form a MDI form you have to set the property IsMdiContainer to true. Children you can add like this:

Visual Basic:
        Dim x As New Form1
        x.MdiParent = MdiForm 'make sure you use a sub Main to make a object from the mdiForm or use me in your mdiForm
        x.Show()
 
That's the normal MDI behaviour...
What I understood that he wants to do is to put a form inside another normal form, not and MDIParent form...

With my method you can add a form inside any IContainer control... ie like a Panel or something like that...

Alex :P
 
Thanks!

AlexCode said:
That's the normal MDI behaviour...
What I understood that he wants to do is to put a form inside another normal form, not and MDIParent form...

With my method you can add a form inside any IContainer control... ie like a Panel or something like that...

Alex :P

Thanks for your info, AlexCode! Also, I like your quote. :)
 
This was one of my first experiences...
Maybe yet on beta version of .net 2002... :D

My quote... arrible... but certainlly most true... :p

Alex :p
 
Back
Top