PublicConstSM_CXFULLSCREEN=16
PublicConstSM_CYFULLSCREEN=17
#IfWin32Then
DeclareFunctionGetSystemMetricsLib"user32"(ByValnIndexAsLong)AsLong
#Else
DeclareFunctionGetSystemMetricsLib"User"(ByValnIndexAsInteger)AsInteger
#EndIf
PublicSubCenterForm(frmAsForm)
frm.Left=Screen.TwipsPerPixelX*GetSystemMetrics(SM_CXFULLSCREEN)/2-frm.Width/2
frm.Top=Screen.TwipsPerPixelY*GetSystemMetrics(SM_CYFULLSCREEN)/2-frm.Height/2
EndSub
只要在Form_Load中使用CenterFormMe即可->
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!


