WinForm窗口拖动
private Point mypoint; private void panel1_MouseDown(object sender, MouseEventArgs e) { mypoint = new Point(-e.X, -e.Y); } private void panel1_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { Point myPosition = MousePosition; myPosition.Offset(mypoint); DesktopLocation = myPosition; } }
鸑鷟虽孤,不匹鹜雏。