标签:
int x,y; void MainFormMouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { x = e.X; y = e.Y; } } void MainFormMouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { this.Location = new Point(this.Location.X + (e.X - x), this.Location.Y + (e.Y - y)); } }
标签:
原文地址:http://www.cnblogs.com/CJSTONE/p/4961853.html