[DllImport("user32.dll")] public static extern bool ReleaseCapture(); [DllImport("user32.dll")] public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); private const int VM_NCLBUTTONDOWN = 0XA1;//定义鼠标左键按下 private const int HTCAPTION = 2; /// <summary> /// 鼠标按下 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void panel1_MouseDown(object sender, MouseEventArgs e) { //为当前应用程序释放鼠标捕获 ReleaseCapture(); //发送消息 让系统误以为在标题栏上按下鼠标 SendMessage((IntPtr)this.Handle, VM_NCLBUTTONDOWN, HTCAPTION, 0); }