Opening child form is causing mdiform to change size and shrink

十年热恋 提交于 2019-12-12 03:24:35

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!