
Dragging a form without a title bar: please help
I'm not sure what the difference is between a child form and any other kind
of form with respect to dragging it around kicking and screaming but I tend
to do the following....
Somewhere declare the following API calls....
Declare Sub ReleaseCapture Lib "user32" ()
Declare Function SendMessageA Lib "user32" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParem As Long, _
lParem As Any) As Long
To move the form by *any* control, in the controls MouseDown event add the
following...
Dim Ret&
Call ReleaseCapture
Ret& = SendMessageA(Me.hWnd, &H112, &HF012, 0)
FOR EXAMPLE:
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
Dim Ret&
Call ReleaseCapture
Ret& = SendMessageA(Me.hWnd, &H112, &HF012, 0)
End Sub
You can add this to a "fake" title bar, label, picturebox, whatever and it
will move the whole form. I don't know if this is what you meant, I'm only
trying to help out.
Richard "Flexman" Hawley, Leeds, England
Longbow 2, 404th KamiKali Squadron
http://www.longbow.co.uk/lb2/ ICQ: 5276356