I have seen a tutorial on csdn before. It is very troublesome to move the Untitled form. We need to redraw the form continuously.
Using this formborderstyle to set the form to none, you can easily customize the form skin, of course, the skin needs to make your own picture.
Today, I accidentally discovered a simpleCode, Called the system API
The following code exists in program. CS:
[Dllimport ( " User32.dll " )]
Public Static Extern Bool Releasecapture ();
[Dllimport ( " User32.dll " )]
Public Static Extern Bool Sendmessage (intptr hwnd, Int Wmsg, Int Wparam, Int Lparam );
Public Const Int Wm_syscommand = Zero X 0112 ;
Public Const Int SC _move = 0xf010 ;
Public Const Int Htcaption = Zero X 0002 ;
Then, enter the following code on the form to implement the function:
Private Void Frminputpsd_mousedown ( Object Sender, mouseeventargs E)
{
// If the mouse pointer is within the range of the title bar and the left mouse button is pressed, the method of moving the title bar is triggered.
If (E. Button = Mousebuttons. Left && E. Y <= 25 )
{
Program. releasecapture ();
Program. sendmessage (This. Handle, program. wm_syscommand, program. SC _move+Program. htcaption,0);
}
}