Postup:
Do deklarační části formuláře zapište:
Private Declare Function
SendMessage Lib "User32" _
Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long
Private Declare Sub ReleaseCapture Lib "User32" ()
Const WM_NCLBUTTONDOWN = &HA1
Const HTCAPTION = 2
Na událost
Form_MouseMove:
Private Sub Form_MouseMove(Button
As Integer, Shift As Integer, _
X As Single, Y As Single)
Dim lngReturnValue As Long
If Button = 1 Then
Call ReleaseCapture
lngReturnValue = SendMessage(Form1.hWnd,
WM_NCLBUTTONDOWN, _
HTCAPTION, 0&)
End If
End Sub
|