Advertisement
JannickP8

PanelDraggableC#

Apr 7th, 2022
1,075
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.23 KB | None | 0 0
  1. MouseDown:
  2.  
  3. lastPoint = new Point(e.X, e.Y);
  4.  
  5. -----------
  6.  
  7. MouseMove:
  8.  
  9. if (e.Button == MouseButtons.Left)
  10. {
  11.     this.Left += e.X - lastPoint.X;
  12.     this.Top += e.Y - lastPoint.Y;
  13. }
  14.  
  15. -----------
  16.  
  17. Variable:
  18.  
  19. Point lastPoint;
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement