我需要把另一种形式的第二种形式与另一种形式的正确边界联系起来。
当我们在启用AERO的情况下编译和运行编译的应用程序(而不是从IDE运行该应用程序时),会发生这样的情况:

因此,感谢GJKH的伟大贡献:How to determine correctly the Non-Client Area Size for Aero?
...Now i可以将次窗体合并到主窗体的右侧,但是次要窗体仍然不对齐从顶部的一点像素:

这是我使用的代码:
If Debugger.IsAttached Then
Form2.Location = New Point(Me.Right, Me.Top)
Else
Form2.Location = New Point((Me.Location.X + (Me.Width + (Me.Width - Me.ClientSize.Width))), Me.Location.Y)
End If发布于 2013-04-27 02:25:35
我把它放在Form1中的一个事件中:
Dim frm As New Form2
frm.Show()
frm.SetDesktopLocation(Me.Width + Me.DesktopLocation.X, Me.DesktopLocation.Y)form2立刻在form1的右边排成一排,他们的上衣完美地排列在一起。
https://stackoverflow.com/questions/16247560
复制相似问题