by Yarden Peleg (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 1st April 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Drag a form without API code
API Declarations
Dim Moving As Boolean
Dim cX, cY
Moving = True
If Moving = True Then
cX = X
cY = Y
End If
End Sub
Private Sub cap_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Moving = True Then
Me.Left = Me.Left - (cX - X)
Me.Top = Me.Top - (cY - Y)
End If
End Sub
Private Sub cap_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Moving = False
End Sub