Este codigo que pongo a continuación lo puso Reydelmundo11 en un post de este foro pero lo vuelvo a poner yo.
Module1.bas
'********************************************************************************
'* Movimiento del formulario *
'* de Reydelmundo11 *
'********************************************************************************
Declare Function ReleaseCapture Lib "user32" () As Long
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const WM_NCLBUTTONDOWN = &HA1
Public Const HTCAPTION = 2
Public Sub FormDrag(theform As Form)
ReleaseCapture
Call SendMessage(theform.hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&)
End Sub
En el form:
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call FormDrag(Form1)
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call FormDrag(Form1)
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call FormDrag(Form1)
End Sub
No olvides de cambiar Form1 por el nombre de tu form pero sin quitar los parentesis.
Saludos y felices navidades