Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Point newpoint = new Point();
- public static int x;
- public static int y;
- // Mouse down
- YOURFORMNAME.x = Control.MousePosition.X - base.Location.X;
- YOURFORMNAME.y = Control.MousePosition.Y - base.Location.Y;
- // Mouse Move
- if (e.Button == MouseButtons.Left)
- {
- YOURFORMNAME.newpoint = Control.MousePosition;
- YOURFORMNAME.newpoint.X -= YOURFORMNAME.x;
- YOURFORMNAME.newpoint.Y -= YOURFORMNAME.y;
- base.Location = YOURFORMNAME.newpoint;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement