C# 弹出层移动

 groupPrint.MouseDown += GroupBox1_MouseDown;

#region 弹出层移动
        [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "ReleaseCapture")]
        public static extern void ReleaseCapture();
        [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "SendMessage")]
        public static extern void SendMessage(int hwnd, int wMsg, int wParam, int lParam);
        private void GroupBox1_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                ReleaseCapture();
                SendMessage((int)groupPrint.Handle, 0xA1, 2, 0);

            }
        }

原文地址:https://www.cnblogs.com/LuoEast/p/11725414.html