winform无边框拖动

        [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 WmSyscommand = 0x0112;
        public const int ScMove = 0xF010;
        public const int Htcaption = 0x0002; 


        private void FrmMouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(Handle, WmSyscommand, ScMove + Htcaption, 0);
        }
原文地址:https://www.cnblogs.com/lishouxiangjs/p/3612998.html