by Pedro (4 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Fri 21st April 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Drag Form from anywhere without API (should work with all versions of VB)
API Declarations
Dim MouseLocationX As Integer
Dim MouseLocationY As Integer
MousePress = 1
MouseLocationX = X
MouseLocationY = Y
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If MousePress = 1 Then
frmMain.Top = frmMain.Top + Y
frmMain.Left = frmMain.Left + X
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
MousePress = 0
End Sub
No comments have been posted about Drag Form from anywhere without API (should work with all versions of VB). Why not be the first to post a comment about Drag Form from anywhere without API (should work with all versions of VB).