Afternoon All,
I have a form with no border(FromBorderStyle = None) and no control box.
I still want the user to be able to move the form.
Is the possible?
Thanks
Printable View
Afternoon All,
I have a form with no border(FromBorderStyle = None) and no control box.
I still want the user to be able to move the form.
Is the possible?
Thanks
Yes, it is possible.
Code:'Declare these 2 variables with class scope
Private Const WM_NCLBUTTONDOWN As Integer = &HA1S
Private Const HTCAPTION As Integer = 2
'Then handle your form.MouseDown event
Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
Me.Capture = False
Dim msg As Message = Message.Create(Me.Handle, WM_NCLBUTTONDOWN, New IntPtr(HTCAPTION), IntPtr.Zero)
Me.DefWndProc(msg)
End Sub
Thats really cool...Thanks mate.