by Venom087 (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 7th October 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Allows the user to move the form via drag and drop without having to use the windows title bar at the top. Useful if you have a form with
API Declarations
Dim varY As Integer
Dim varX As Integer
Call MDown(X, Y)
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MMove(X, Y)
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MUp(X, Y)
End Sub
Private Sub MUp(X2 As Single, Y2 As Single)
Down = False
End Sub
Private Sub MMove(X2 As Single, Y2 As Single)
If Down = True Then
Form1.Left = Form1.Left + X2 - varX
Form1.Top = Form1.Top + Y2 - varY
X2 = varX
Y2 = varY
End If
End Sub
Private Sub MDown(X2 As Single, Y2 As Single)
Down = True
varX = X2
varY = Y2
End Sub
No comments have been posted about Allows the user to move the form via drag and drop without having to use the windows title bar at t. Why not be the first to post a comment about Allows the user to move the form via drag and drop without having to use the windows title bar at t.