Private Sub Form_Load() Me.Move (mdifrm.Width - Me.Width) / 2, (mdifrm.Height - Me.Height) End Sub
'自定义一个函数 Public Sub showme(frm As Form) On Error Resume Next frm.Show frm.Move mdimain.width / 2 - frm.width / 2, mdimain.Height / 2 - frm.Height / 2 End Sub '然后在代码中调用 showme Form1
Private Sub Form_Load() Me.Move (mdifrm.Width - Me.Width) \2, (mdifrm.Height - Me.Height)\2 End Sub
Me.Move (mdifrm.Width - Me.Width) / 2, (mdifrm.Height - Me.Height)
End Sub
Public Sub showme(frm As Form)
On Error Resume Next
frm.Show
frm.Move mdimain.width / 2 - frm.width / 2, mdimain.Height / 2 - frm.Height / 2
End Sub
'然后在代码中调用
showme Form1
Me.Move (mdifrm.Width - Me.Width) \2, (mdifrm.Height - Me.Height)\2
End Sub