问题
I am having a basic problem opening a child form in an mdiForm.
Dim frm As New Form1
frm.MdiParent = Me
frm.Show()
I have some code in the Form-Load event of the child form to open up connection to access db (connection opens fine).
Try
conn.Open()
catch ex As Exception
Msgbox("connection error")
End Try
MdiForm is set to open up in a Maximized state. When the app runs, mdiForm opens up normal and the Menustrip looks normal size as well. However, when I try to open up a child form (Form1 in this case) from the MenuStrip, the mdiForm remains in Maximized state but no longer covers the screen and the menustrip shrinks (the words become much smaller fonts) and then the form objects (labels and textboxes) also get smaller. If i comment the code in Form-Load i do not get this problem.
I would like everything to remain the same size just before the child form was opened.
来源:https://stackoverflow.com/questions/38452774/opening-child-form-is-causing-mdiform-to-change-size-and-shrink