Guest User

Untitled

a guest
Dec 10th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. private bool MouseDown { get; set; }
  2. private System.Drawing.Point LastLocation { get; set; }
  3.  
  4. private void labelGetId_MouseDown(object sender, MouseEventArgs e)
  5. {
  6. MouseDown = true;
  7. LastLocation = e.Location;
  8. }
  9.  
  10. private void labelGetId_MouseMove(object sender, MouseEventArgs e)
  11. {
  12. if (MouseDown)
  13. {
  14. this.Location = new System.Drawing.Point(
  15. (this.Location.X - LastLocation.X) + e.X, (this.Location.Y - LastLocation.Y) + e.Y);
  16.  
  17. this.Update();
  18. }
  19. }
  20.  
  21. private void labelGetId_MouseUp(object sender, MouseEventArgs e)
  22. {
  23. MouseDown = false;
  24. }
Add Comment
Please, Sign In to add comment