C#怎么样实现窗体的移动
高手帮忙 C#怎么样实现窗体的移动
private const int WM_SysCommand = 0x0112;
private const int OneMsgNum = 0xf017;
[DllImport("user32")]
private static extern bool ReleaseCapture();
[DllImport("user32")]
private static extern bool PostMessage(int hWnd, int Mwg, int wParam, int lParam);
在MOUSEDOWN里面加入
ReleaseCapture();
PostMessage((int)this.front.Handle, WM_SysCommand, OneMsgNum, 0);
那种效果是向系统发送的参数有误,OX0012和OXF017才好,
ReleaseCapture();是捕获MOUSE坐标,
第二个是向系统发送当时消息,通知要移动