Does anyone Know how to embed forms in forms or panels

lickuid

Active member
Joined
Nov 6, 2006
Messages
37
Programming Experience
Beginner
I'm trying to create a work area that once a document is created, it will open a window embedded inside a panel. Anyone know How?
 
It can be done when child forms .TopLevel property is False and the form instance is added to the .Controls collection, but why do you want to do it this way? It is more natural when you need to add a pre-set layout of controls to use a custom UserControl, this you design just like a form except is works as a single control.
 
Thanks, Hmm.. I'll do some research but is there a way to make a simple code example, or is it a long, drawn out process?
 
VB.NET:
dim c as new childform
c.toplevel=false
me.panel1.controls.add(c)
 
Oh, you meant MDI? MDI is not the same as you asked for, MDI is not a form in a 'panel', but a special forms feature for organizing child forms within the parent window, the underlying control that work this is called a MDIClient (but this is usually transparent even for the programmer). As you saw in that article you don't use the above code, but set set first the parent form IsMdiContainer to True, then set the MDIParent property for the child form to the reference of the MDI parent form, ex:
VB.NET:
'(Me.IsMdiParent = True 'usually done in Designer
'
'add mdi child:
dim c as new childform
c.mdiparent = Me
c.show
 
Back
Top