To move a form without borders or to move any other object with a mouse when the user clicks on it
To move a form without borders or to move any other object with a mouse when the user clicks on it and releases.
API Declarations
Public oldX As Integer
Public oldY As Integer
Rate To move a form without borders or to move any other object with a mouse when the user clicks on it
(2(2 Vote))
Private Sub mover_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
msDown = True 'Tells it the mouse is down on the object
oldX = X 'Gets the X position of the mouse on the object
oldY = Y 'Gets the Y position of the mouse on the object
End Sub
Private Sub mover_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If msDown = True Then 'If the mouse is down then...
Form1.Left = Form1.Left + X - oldX 'Move the form with the mouse
Form1.Top = Form1.Top + Y - oldY
End If
End Sub
Private Sub mover_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
msDown = False 'Tells it the mouse has been released
End Sub
To move a form without borders or to move any other object with a mouse when the user clicks on it Comments
No comments yet — be the first to post one!
Post a Comment