表格与父母表格对齐(左或右)

时间:2014-02-12 04:39:27

标签: vb.net winforms

如何从父表单中对齐/浮动其他表单?

我所能找到的只是MDI,根据我的理解,mdi会使表单在表单中可见,但我想要的是将其他表单与父表项对齐。有可能吗?

1 个答案:

答案 0 :(得分:0)

从原帖:

嗯,在深入研究的过程中,我找到了答案

Dim test As Integer = Form1.Width / 2
Dim sh As Integer = Screen.PrimaryScreen.Bounds.Height / 2
Dim sw As Integer = Screen.PrimaryScreen.Bounds.Width / 2

Dim nX As Integer = sw + (Form1.Width / 2) - 20
Dim nY As Integer = sh - (Form1.Height / 2)

Private Sub Form_Login_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  Me.Location = New Point(nX, nY)
  MsgBox(nX & ", " & nY)
End Sub