11.6 How can I drag a window if it doesn't have a title bar or border?
http://www.syncfusion.com/FAQ/WinForms/FAQ_c50c.asp#q699q

解决方案 »

  1.   

    这就是C#的啊。using System.Runtime.InteropServices;
         ............
         public const int WM_NCLBUTTONDOWN = 0xA1;
         public const int HTCAPTION = 0x2;     [DllImportAttribute ("user32.dll")]
         public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);     [DllImportAttribute ("user32.dll")]
         public static extern bool ReleaseCapture();     private void Form2_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
         {
              ReleaseCapture();
              SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);
         }