|
|
Title | Let the user move a form without a title bar |
Keywords | move form, no title bar, drag form |
Categories | Controls, 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
|
|
|
|
|
|