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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to load a form into a panel 2

Status
Not open for further replies.

bartdedecker

Programmer
Feb 22, 2005
17
0
0
BE
Hi,

How can I load a form into a panel?

Bart
 
I you try to do it, you'll get this message:
"Cannot add top level control to a control", since a form is a top level control.
Make a user control and put it in the panel.
panel1.Controls.Add(MyUserControl)
 
There is a way to do this, Chrissie posted it I beleive. search the FAQs and forum for "top level control" I know it's been covered with in the last 5 months.

-Rick

----------------------

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Korach,

What do you exactly mean with "Make a user control"

Bart
 
Right click on your project and select "Add". In the menu you'll see "Add User Control". User Control is like a form but without the ability to be a top level control. In order to use it you need to add it to a form or any other container.
Maybe you can add a form to a panel, but I don't think this is the right way.
 
Does a User Control has the same possibilities like a form?
 
yes I did cover this and yes it is possible
once again.

Code:
dim frm2 as new form2
frm2.toplevel = false
me.controls.add(frm2)
frm2.show

Don't tell me I'm a genius I already know.


Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top