by rikkter (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (19 Votes)
Move any form without a title bar! You can use a label, command button, picturebox, anything to move the form.
'Put this in a module:
Declare Sub ReleaseCapture Lib "user32" ()
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wparam As Integer, ByVal iparam As Long) As Long
Public Sub formdrag(theform As Form)
ReleaseCapture
Call SendMessage(theform.hWnd, &HA1, 2, 0&)
End Sub
'**************
'put this in the object that u want to move the form in the MouseDown:
formdrag Me
'thats it...vote for me if u like it...or email me if u need help...it should work...worked for me