Home
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
 
 
 
 
TitleLet the user move a form without a title bar
Keywordsmove form, no title bar, drag form
CategoriesControls, API
 
Place a PictureBox (or other things for the user to grab) on the form. In the control's MouseDown event handler, use the ReleaseCapture API function to cancel the mouse event. Then send the form the WM_NCLBUTTONDOWN message with the HTCAPTION parameter. This tells the form that the user has pressed the mouse down on its title bar and that starts moving the form.
 
Private Sub Picture1_MouseDown(Button As Integer, Shift As _
    Integer, X As Single, Y As Single)
    ReleaseCapture
    SendMessage hwnd, WM_NCLBUTTONDOWN, _
        HTCAPTION, 0&
End Sub
 
 
Copyright © 1997-2001 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated