我一直在尝试解决程序中出现的问题。我从菜单中打开的所有表单都拒绝以MDIParent
形式居中。因为我使用2个面板来设计自定义工具栏(包含关闭和最小化按钮)和另一个关于菜单的面板。
这是一张解释我在解决问题方面的努力的图片。
我尝试过的事情:
Private Sub RegistarDevoluçãoToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles RegistarProjetoToolStripMenuItem.Click
Dim janela As New frmRegProjeto
janela.MdiParent = Me
janela.StartPosition = FormStartPosition.CenterParent
janela.Show()
End Sub
答案 0 :(得分:1)
Hans Passant的回答:
由于它无法在MDI子窗口的特定情况下工作,因此CenterScreen对象应该完成工作:
Private Sub RegistarDevoluçãoToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles RegistarProjetoToolStripMenuItem.Click
Dim janela As New frmRegProjeto
janela.MdiParent = Me
janela.StartPosition = FormStartPosition.CenterScreen
janela.Show()
End Sub