slightlyoff
asked on
Maximize Child Form inside MDI parent, VB.NET
How do I maximize the child form so it fills the MDI Parent?
My MDI parent fills the entire monitor, but the child only fills a portion of the MDI Parent. Since I dont' always know what resolution someone will be viewing at, I can't really hard code this.
Any ideas?
Thanks!
My MDI parent fills the entire monitor, but the child only fills a portion of the MDI Parent. Since I dont' always know what resolution someone will be viewing at, I can't really hard code this.
Any ideas?
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just FYI, the two answers above produce different results...the "correct" one depends on your app I suppose. =)
Dock.Fill doesn't merge with the MdiParent or update the main Form caption while WindowState.Maximized does:
MdiChildWindowstateMaximized.jpg
Dock.Fill doesn't merge with the MdiParent or update the main Form caption while WindowState.Maximized does:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim f2 As New Form2
f2.mdiparent = Me
f2.Dock = DockStyle.Fill
f2.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim f2 As New Form2
f2.MdiParent = Me
f2.WindowState = FormWindowState.Maximized
f2.Show()
End Sub
End Class
MdiChildDockFilled.jpgMdiChildWindowstateMaximized.jpg
ASKER
I appreciate the insight. I saw that it worked and awarded the points (i didn't get a chance to test your solution) - but I can see where your answer is correct as well.
thank you for going the extra mile to explain the difference! It's helpful for a newb like me.
thank you for going the extra mile to explain the difference! It's helpful for a newb like me.
No problem...good luck!
Open in new window