private int x = 0; private int y = 0; public Form1() { InitializeComponent(); } private void button1_MouseDown(object sender, MouseEventArgs e) { x = e.X; y = e.Y; } private void button1_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { button1.Left = (button1.Left + e.X) - x; button1.Top = (button1.Top +e.Y)-y; }
burhansuleymanvural@windowslive.com