How to make a Child form fill a parent?

  • Thread starter Thread starter Anil Gupte
  • Start date Start date
A

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,
 
Remove the Dock, and put this in the Load event instead:

Me.WindowState = FormWindowState.Maximized

Works just like you clicked Maximize.
 
Back
Top