winform无系统边框时移动窗体

 1         [DllImport("user32.dll")]
 2         public static extern bool ReleaseCapture();
 3         [DllImport("user32.dll")]
 4         public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
 5         public const int WM_SYSCOMMAND = 0x0112;
 6         public const int SC_MOVE = 0xF010;
 7         public const int HTCAPTION = 0x0002;
 8 
 9         private void Form_Login_MouseDown(object sender, MouseEventArgs e)
10         {
11             ReleaseCapture();
12             SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
13         }
原文地址:https://www.cnblogs.com/refresh/p/2605953.html