private void button1_MouseDown(object sender, MouseEventArgs e) { btnStandard = (Button)sender; if (!this.dragInProgress) { this.dragInProgress = true; this.MouseDownX = e.X; this.MouseDownY = e.Y; } return; } private void button1_MouseMove(object sender, MouseEventArgs e) { if (dragInProgress) { Point temp = new Point(); temp.X = this.btnStandard.Location.X + (e.X - MouseDownX); temp.Y = this.btnStandard.Location.Y + (e.Y - MouseDownY); this.btnStandard.Location = temp; } } private void button1_MouseUp(object sender, MouseEventArgs e) { btnStandard = (Button)sender; if (e.Button == MouseButtons.Left) { this.dragInProgress = false; } return; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)