NeonFox__

Draggable Code

May 16th, 2020
8,635
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. ------------------------------------------------------------
  2. Mouse Move Event
  3. -----------------------------------------------------------
  4. if (e.Button == MouseButtons.Left)
  5. {
  6. this.Left += e.X - lastPoint.X;
  7. this.Top += e.Y - lastPoint.Y;
  8. }
  9.  
  10. ------------------------------------------------------------
  11. Mouse Down Event
  12. -----------------------------------------------------------
  13.  
  14. lastPoint = new Point(e.X, e.Y);
  15.  
  16.  
  17.  
  18. ------------------------------------------------------------
  19. Declare variable as shown in the video
  20. -----------------------------------------------------------
  21. Point lastPoint;
Comments
Add Comment
Please, Sign In to add comment