Home All Groups Group Topic Archive Search About

How to make a Child form fill a parent?

Author
20 Sep 2006 12:16 PM
Anil Gupte
I am using the following:

Private Sub FormContainer_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
frmMain.MdiParent = Me
frmSliceInfo.MdiParent = Me
frmMain.Show()
frmMain.Dock = DockStyle.Fill
End Sub

where the FormContainer is the parent and the frmMain is the default child
form.  The child appears to go till the parent, but shows its border and
header bar.  If I click the maximize box, I get what I want.  How can I
force it to completely fill it when it loads?
Thanx,

Author
26 Sep 2006 9:31 PM
teslar91
Remove the Dock, and put this in the Load event instead:

Me.WindowState = FormWindowState.Maximized

Works just like you clicked Maximize.