VB 程序设计

10个成员

让窗体居中

发表于 2016-12-21 3085 次查看
在主窗体的Form_load()中的最前面加入下列代码:
Dim X0 As long
Dim Y0 As Long

'让窗体居中
X0 = Screen.Width
Y0 = Screen.Height
X0 = (X0 - Me.Width) / 2
Y0 = (Y0 - Me.Height) / 2
Me.Move X0, Y0

 

发表回复
你还没有登录,请先登录注册