Cloud some one help me out..
I need a form to move with the cursor
when the back of the form is clicked.. and then
stop following the cursor when the
mouse is released..
I cant figure it out.. thanks!
Printable View
Cloud some one help me out..
I need a form to move with the cursor
when the back of the form is clicked.. and then
stop following the cursor when the
mouse is released..
I cant figure it out.. thanks!
Code:Private Declare Function ReleaseCapture Lib "user32" () As Long
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 Sub FormDrag(frm As Form)
ReleaseCapture
Call SendMessage(frm.hwnd, 161, 2, 0&)
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
FormDrag(Me)
End Sub
This code is cool!
Try using it for command buttons and other stuff!