اينم كدش :
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" ()
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const HTCAPTION = 2

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim lngReturnValue As Long
'// Detect the left mouse button
If Button = 1 Then
'// Release the capture of the mouse
Call ReleaseCapture
'// Move the form with the mouse
lngReturnValue = SendMessage(Me.hWnd, WM_NCLBUTTONDOWN, _
HTCAPTION, 0&)
End If
End Sub