VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Drag Form from anywhere without API (should work with all versions of VB)

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


Rate Drag Form from anywhere without API (should work with all versions of VB)



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


Download this snippet    Add to My Saved Code

Drag Form from anywhere without API (should work with all versions of VB) Comments

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).

Post your comment

Subject:
Message:
0/1000 characters