Whenever I minimize or maximize an MDI Parent form while it has a child form maximized, the height of the MDI Parent shrinks by roughly 20px.
I started out with .Net Framework 4.0 and had this problem, so I tried other versions and continued to have problem.
Here are some steps to replicate (trying 4.7.1 this time):
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim frm As New ChildForm
frm.MdiParent = Me
frm.WindowState = FormWindowState.Maximized
frm.Show()
End Sub
Is anyone able to replicate this or is this just a bug on my machine? My resolution is 2560x1440 and scaling is set to 100%. If I change AutoScaleMode on Form1 and ChildForm from "Font" (default) to "None", I still have this problem. If I do not have an MDI Child form maximized when I Minimize/Maximize the MDI Parent, the MDI Parent height does not shrink when restored.
After doing a lot of searching and not finding anyone else with this bug, I started asking myself: "why would others not have this problem". Well, my program will not have a MenuStrip, but almost all MDI parent forms have one. So, on a hunch, I added a menu strip to the form and it fixed my problem. I then set the visibility of the MenuStrip to false and tested... it still works with MenuStrip visibility set to false.