Advertisement
ada1711

Untitled

Apr 28th, 2023
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 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.Drawing;
  7. using System.Windows.Forms;
  8.  
  9. namespace MemoryGame
  10. {
  11. internal class MemoryCard : Label
  12. {
  13. public Guid Id;
  14. public Image Tyl;
  15. public Image Obrazek;
  16.  
  17. public MemoryCard(Guid Id, string tylSciezka, string obrazekSciezka)
  18. {
  19. this.Id = Id;
  20. this.Tyl = Image.FromFile(tylSciezka);
  21. this.Obrazek = Image.FromFile(obrazekSciezka);
  22. BackgroundImageLayout = ImageLayout.Stretch;
  23.  
  24. }
  25. public void Zakryj()
  26. {
  27. BackgroundImage = Tyl;
  28. Enabled = true;
  29. }
  30.  
  31. public void Odkryj()
  32. {
  33. BackgroundImage = Obrazek;
  34. Enabled = false;
  35. }
  36.  
  37.  
  38. }
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement