How to make a Child form fill a parent?

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,
 
T

teslar91

Remove the Dock, and put this in the Load event instead:

Me.WindowState = FormWindowState.Maximized

Works just like you clicked Maximize.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top