打印本文 打印本文  关闭窗口 关闭窗口  
使窗体居中显示代码
作者:佚名  文章来源:不详  点击数  更新时间:2008/7/28 12:15:45  文章录入:杜斌  责任编辑:杜斌

  使窗体居中显示代码

  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

打印本文 打印本文  关闭窗口 关闭窗口