直接贴代码
-----------------------------------
有更好的方法可以讨论讨论哈
==================================
[DllImport("user32.dll")]
public static extern bool ReleaseCapture();
[DllImport("user32.dll")]
public static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wparam, int lparam);
private void panzHead_MouseDown(object sender, MouseEventArgs e) {
if (e.Button == MouseButtons.Left) {
// 释放鼠标使能够手动操作
//ReleaseCapture();
this.panzHead.Capture = false;
// 拖动窗体
//SendMessage(this.Handle, 0x0112, 0xF010 + 0x0002, 0);
SendMessage(this.Handle, 0x00A1, 2, 0);
}
}