private int x;
private int y;
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
this.x = e.X;
this.y = e.Y;
}
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
this.Location = new Point(this.Location.X + e.X - this.x, this.Location.Y + e.Y - this.y);
}
}
无边框窗体移动
最新推荐文章于 2025-06-09 13:28:16 发布