窗体拖动不闪
private void Panel_MouseDown(object sender, MouseEventArgs e) { mousePoint = new Point(e.X,e.Y); } private void Panel_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { //this.SetBounds(this.Location.X + e.X - mousePoint.X, this.Location.Y + e.Y - mousePoint.Y, this.Width, this.Height); this.SetBounds(this.Location.X + e.X - mousePoint.X, this.Location.Y + e.Y - mousePoint.Y, this.Width, this.Height); //this.SetBounds(this.Location.X + e.X, this.Location.Y + e.Y , this.Width, this.Height); } }