Using C#.
I am trying to move a Form
without its title bar.
I found an article about it on: http://www.codeproject.com/KB/cs/csharpmovewindow.aspx
It works as long as I do not set FormBorderStyle
as None
.
Is there a way to make it work with this property set as None
?
Point mousedownpoint = Point.Empty;
I had the same question a while ago and while searching for the answer I found the code below(don't remember the website) and Here is what I do:
I know this question is over a year old, but I was searching trying to remember how I've done it in the past. So for anyone else's reference, the quickest and less complex way then the above link is to override the WndProc function.
This will allow any form to be moved by clicking and dragging within the client area.
First we will have to use the interop services by using the namespace as
The next thing would be to define the messages that will take care of moving the form. We will have these as class member variables
and finally we will write the code to send the message whenever the user presses the mouse button. The form will be repositioned as per the mouse movement if the user keep the mouse button pressed.
Refer this link Dragable form
Credits to rahul-rajat-singh
Here it is the best way I have found. It is a ".NET way", wihout using WndProc. You just have to handle the MouseDown, MouseMove and MouseUp events of the surfaces you want to be draggable.