VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Drag a form WITHOUT a title bar

Dennis Wrenn  (2 Submissions)   Miscellaneous   Visual Basic 3.0   Beginner   Wed 3rd February 2021

With this code you can easily drag a form without a titlebar.

Assumes
If you dont add If Button = 1 etc.. then if you left click, then right click the form will continue to move even though you arent clicking, its like the form is stuck to your mouse

API Declarations
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const HTCAPTION = 2

Rate Drag a form WITHOUT a title bar (6(6 Vote))
Drag a form WITHOUT a title bar.bas

Drag a form WITHOUT a title bar Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters