A Programmers thoughts
How to make borderless form draggable?
Making 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 Sub
| Print article | This entry was posted by shyguy on May 7, 2009 at 9:45 pm, and is filed under Vb.net Code and Snippets. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |











about 1 year ago
Hello,
Thanks for article. Everytime like to read you.
Have a nice day
about 1 year ago
It is the coolest site,keep so!
about 1 year ago
Hi, Onload of page my antivirus put alert, check pls.
Have a nice day
Bodyc
about 1 year ago
I think the there’s no conflict between anti virus and your code. What anti-virus you are using now?
about 1 year ago
Excellent site, It was pleasant to me.
about 1 year ago
You know so many interesting infomation. You might be very wise. I like such people. Don’t top writing.
about 1 year ago
Thanks
about 5 months ago
Hey
Just a quick hello from as I’m new to the board. I’ve seen some interesting comments so far.
To be honest I’m new to forums in general
John
about 4 months ago
Dear friends,
My name is Adelina. I am a 22 years girl from Italy. I was looking for a free translation software and I found one.
Program’s name is Babel Fish and iIt supports 75 languages. I installed it but I could not understand how to use it. I am not a computer expert. Can someone help me please on how to run this.
The link is here:
http://access.im/3/babelfish
I thank you very much for your help.