模块:
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Declare Function ReleaseCapture Lib "user32" () As Long
Public Const WM_NCLBUTTONDOWN = &HA1
Public Const HTCAPTION = 2
应用:
Private Sub Form_Close()
DoCmd.RunCommand acCmdAppMaximize
End Sub
Private Sub Form_Load()
DoCmd.RunCommand acCmdAppMinimize
End Sub
Private Sub XPForm_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
ReleaseCapture
SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
End If
End Sub
Private Sub 命令20_Click()
DoCmd.Close
End Sub