Form within a Form

archer_coal

Regular
Joined
Apr 4, 2003
Messages
96
Ive never done this before so i have no idea where to start.

Just like in Microsoft word, access, excel etc
when the program loads there is a workspace

is it possibel to have a fixed or dockable form within the primary form?
 
You cant just put a form within a form.
You have to use MDI or just have multiple forms or dock your windows.
 
Just Pur Form's property "IsMdiContainer" to true and it will become a mdi parent form.

next if you want to open any form inside that just put its MDIParent property to the instance of MDI form.

such as

dim frmA as new frmChiled
frmA.MdiParent = FrmMDI.Activeform
frma.show()
 
Note that there is a severe memmory-leak in this type of an aplication.. see the mdi-list topic below..

regards hilmar
 
Try this then.. Make a new instance of your secondary form, then set
Code:
Form2.TopLevel = False

then just add it to your main form like its a control
you can still drag it around with the title bar, or if you set formborderstyle to none, it even looks like a regular control
 
or if you want a standard ( none mdi form ) within another standard form try the winapi with this.
Code:
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
setting the parent for Form2 as Form1 will put Form2 inside it:)
another alternative to try.
 
Back
Top