设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

使窗体居中显示代码

1970-1-1 08:00| 发布者: 黄海| 查看: 2313| 评论: 0


使窗体居中显示代码
ACCESS中的窗体虽然设置了自动居中,但是打开后总是有点不居中的感觉,加下如下代码可以做到真正居中显示

Private Sub Form_Load()
DoCmd.Echo False
Dim x, y As Integer
DoCmd.Maximize
x = Me.WindowWidth
y = Me.WindowHeight
DoCmd.Restore
DoCmd.Echo True
Move (x - Me.WindowWidth) / 2, (y - Me.WindowHeight) / 2
End Sub

最新评论

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-5-7 03:32 , Processed in 0.079991 second(s), 16 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

返回顶部