|
把启动窗体设为弹出模式并在窗体加载事件中加入DoCmd.RunCommand acCmdAppMinimize 就能对数据库进行隐藏。大家可能也碰到过这样的情况,同样的代码同样是弹出模式,主窗体为何有时是缩少到最小化,有时却能正常显示呢?先不说原因,下面的代码也许对你有所帮助
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
Const SW_SHOWNORMAL = 1
Private Sub Form_Load()
DoCmd.RunCommand acCmdAppMinimize
SetForegroundWindow Me.hWnd
ShowWindow Me.hWnd, SW_SHOWNORMAL
Me.SetFocus
End Sub |
|