fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace WindowsFormsApplication1
  11. {
  12. class DdBotton : Button
  13. {
  14. public DdBotton()
  15. {
  16. this.MouseDown += new MouseEventHandler(DdBotton_MouseDown);
  17. this.MouseUp += new MouseEventHandler(DdBotton_MouseUp);
  18. this.MouseMove += new MouseEventHandler(DdBotton_MouseMove);
  19. }
  20. Point MousePoint;
  21. void DdBotton_MouseMove(object sender, MouseEventArgs e)
  22. {
  23. if ((e.Button & MouseButtons.Left) == MouseButtons.Left)
  24. {
  25. if (this.MousePoint != Point.Empty)
  26. {
  27. this.Left += e.X - this.MousePoint.X;
  28. this.Top += e.Y - this.MousePoint.Y;
  29. }
  30. }
  31. }
  32.  
  33. void DdBotton_MouseUp(object sender, MouseEventArgs e)
  34. {
  35. this.MousePoint = Point.Empty;
  36. }
  37.  
  38. void DdBotton_MouseDown(object sender, MouseEventArgs e)
  39. {
  40. if((e.Button & MouseButtons.Left) == MouseButtons.Left)
  41. {
  42. if (this.MousePoint == Point.Empty)
  43. {
  44. this.MousePoint = new Point(e.X, e.Y);
  45. }
  46. }
  47. }
  48. }
  49. }
  50.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty