Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Forms;
  7.  
  8. namespace ProgramZaliczenieJiPP5
  9. {
  10. class SuperPrzycisk : Button
  11. {
  12. public event EventHandler TripleClick;
  13. public SuperPrzycisk()
  14. {
  15. this.BackColor = System.Drawing.Color.Red;
  16. this.Click += superPrzycisk1_Click;
  17. }
  18.  
  19. public int PrzyciskCounter { get; private set; }
  20.  
  21. private void superPrzycisk1_Click(object sender, EventArgs e)
  22. {
  23. PrzyciskCounter++;
  24. if (PrzyciskCounter == 3)
  25. {
  26. if (TripleClick !=null)
  27. {
  28. TripleClick(sender, e);
  29. }
  30. }
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement