Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 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. using System.Drawing;
  8.  
  9. namespace WindowsFormsMinesweeper
  10. {
  11. class FieldButton : Button
  12. {
  13. private readonly int width = 40;
  14. private readonly int height = 40;
  15.  
  16.  
  17. public FieldButton(int x, int y)
  18. {
  19. this.Location = new Point(x, y);
  20.  
  21. this.Width = width;
  22. this.Height = height;
  23.  
  24. //this.BackgroundImage = Image.FromFile(@"C:\Users\Rasmu\Desktop");
  25.  
  26. this.MouseClick += new MouseEventHandler(FieldClicked);
  27. }
  28.  
  29. private void FieldClicked(object sender, MouseEventArgs e)
  30. {
  31. switch (e.Button)
  32. {
  33. case MouseButtons.Left:
  34. ClearField();
  35. break;
  36.  
  37. case MouseButtons.Right:
  38. FlagField();
  39. break;
  40.  
  41. }
  42.  
  43.  
  44. }
  45.  
  46. private void ClearField()
  47. {
  48.  
  49. }
  50.  
  51. private void FlagField ()
  52. {
  53.  
  54. }
  55.  
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement