Moving app window with FormBorderStyle set to None
-
Hello I am creating an application with no FormBorder, and I want the user to be able to move the application as if there was FormBorders. It is something similar to Microsoft Live Messenger (In MLM you can move the window by holding down the left mouse button) So I want to move the application when the user holds down the left mouse button on a picturebox. Is there any way to do that with C#? If so can you tell me an article which describe it, or maybe tell me how to do it? Thanks QzRz
-
Hello I am creating an application with no FormBorder, and I want the user to be able to move the application as if there was FormBorders. It is something similar to Microsoft Live Messenger (In MLM you can move the window by holding down the left mouse button) So I want to move the application when the user holds down the left mouse button on a picturebox. Is there any way to do that with C#? If so can you tell me an article which describe it, or maybe tell me how to do it? Thanks QzRz
This can be done by handling the
WM_NCHITTEST
message and returningHTCAPTION
when the cursor is over the picturebox. ReturningHTCAPTION
regardless of the cursor position will allow the user to drag your form by clicking anywhere within it. /raviMy new year's resolution: 2048 x 1536 Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com
-
Hello I am creating an application with no FormBorder, and I want the user to be able to move the application as if there was FormBorders. It is something similar to Microsoft Live Messenger (In MLM you can move the window by holding down the left mouse button) So I want to move the application when the user holds down the left mouse button on a picturebox. Is there any way to do that with C#? If so can you tell me an article which describe it, or maybe tell me how to do it? Thanks QzRz