当我尝试用这个拖动我的窗口时,窗口会跳跃并闪烁:
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_MOVE)
{
int x = (m.LParam.ToInt32() & 0xffff);
int y = ((m.LParam.ToInt32() >> 16) & 0xffff);
if (x < 500)
Location = new Point(0, y);
else
base.WndProc(ref m);
}
else
base.WndProc(ref m);
}
- 必须停止跳跃
WM_MOVE
,WM_MOVING
,WM_WINDOWPOSCHANGING
或其他移动事件必须在拖动窗口时继续触发,因为我希望检查每个新位置。- 另一个问题是
Location = new Point(0, y);
触发另一个移动事件(这个应该被忽略)
请帮忙!