-
How to make borderless form draggable?
Posted on May 7th, 2009 7 commentsMaking a form without a border is nice to see especially when the user don’t want his form to minimize and maximize. I have here the following code that will make a borderless form draggable.
‘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 Sub7 responses to “How to make borderless form draggable?”

-
Hello,
Thanks for article. Everytime like to read you.
Have a nice day -
It is the coolest site,keep so!
-
Hi, Onload of page my antivirus put alert, check pls.
Have a nice day
Bodyc -
Excellent site, It was pleasant to me.
-
You know so many interesting infomation. You might be very wise. I like such people. Don’t top writing.
-
Thanks
Leave a reply
-













Rufor May 10th, 2009 at 22:37