-
Can someone help me, by explaining to me how to remove the TitleBar, Controlbox, Min and Max Buttons from a form but still have the form moveable, or at least having the Title bar invisible, but still being able to move the form dragging any part of it.
Cheers
-
Code:
'
'set the form's controlbox property = false
'set the form caption = ""
'Make A Titleless Form Moveable With Mouse Drag
'Add the following code to the declarations section of a form
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 Sub ReleaseCapture Lib "User32" ()
Const WM_NCLBUTTONDOWN = &HA1
Const HTCAPTION = 2
'Add this code to the form's MouseMove procedure:
'
Dim lngReturnValue As Long
If Button = 1 Then
Call ReleaseCapture
lngReturnValue = SendMessage(Form1.hWnd, WM_NCLBUTTONDOWN, _
HTCAPTION, 0&)
End If
-
<?>
stupid smilies..
HTCAPTION, 0&)
is HTCAPTION, 0& [closing bracket] )
-
Thanks very much HSJ, it works brilliantly.