Например так
| Код | 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 Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 1 Then Call ReleaseCapture Call SendMessage(hwnd, &HA1, 2, 0&) End If
End Sub
|
или так
| Код | Dim IfMove As Boolean Dim X1 As Integer Dim Y1 As Integer
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) IfMove = True X1 = X Y1 = Y End Sub
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If IfMove Then Move Left + X - X1, Top + Y - Y1 End If End Sub
Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) IfMove = False End Sub
|
|