Advertisement
DrAungWinHtut

Three Card CSharp

Feb 15th, 2022
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.19 KB | None | 0 0
  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.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace _2022021501_Three_Card
  12. {
  13.     public partial class frmThreeCard : Form
  14.     {
  15.         public frmThreeCard()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void frmThreeCard_Load(object sender, EventArgs e)
  21.         {
  22.             this.Text = "Three Card Game";
  23.             picOne.Image = Image.FromFile("D:\\CStutorial\\baydin\\back.png");
  24.             picOne.SizeMode = PictureBoxSizeMode.StretchImage;
  25.  
  26.             picTwo.Image = Image.FromFile("D:\\CStutorial\\baydin\\back.png");
  27.             picTwo.SizeMode = PictureBoxSizeMode.StretchImage;
  28.  
  29.             picThree.Image = Image.FromFile("D:\\CStutorial\\baydin\\back.png");
  30.             picThree.SizeMode = PictureBoxSizeMode.StretchImage;
  31.  
  32.             txtBaydin .Enabled = false;
  33.             txtBaydin.ForeColor = Color.Red;
  34.             txtBaydin.SelectionAlignment= HorizontalAlignment.Center;
  35.          
  36.         }
  37.  
  38.         private void picOne_Click(object sender, EventArgs e)
  39.         {
  40.             picOne.Image = Image.FromFile("D:\\CStutorial\\baydin\\king.png");
  41.             picTwo.Image = Image.FromFile("D:\\CStutorial\\baydin\\back.png");
  42.             picThree.Image = Image.FromFile("D:\\CStutorial\\baydin\\back.png");
  43.             picOne.Enabled = false;
  44.             picTwo.Enabled = false;
  45.             picThree.Enabled = false;
  46.             txtBaydin.Text = "King, သင်ကံကောင်းနေသည်";
  47.            
  48.         }
  49.  
  50.         private void picTwo_Click(object sender, EventArgs e)
  51.         {
  52.             picTwo.Image = Image.FromFile("D:\\CStutorial\\baydin\\queen.jpg");
  53.             picOne.Image = Image.FromFile("D:\\CStutorial\\baydin\\back.png");
  54.             picThree.Image = Image.FromFile("D:\\CStutorial\\baydin\\back.png");
  55.             picOne.Enabled = false;
  56.             picTwo.Enabled = false;
  57.             picThree.Enabled = false;
  58.             txtBaydin.Text = "Queen, မဆိုးပါဘူး";
  59.         }
  60.  
  61.         private void picThree_Click(object sender, EventArgs e)
  62.         {
  63.             picThree.Image = Image.FromFile("D:\\CStutorial\\baydin\\fool.jpg");
  64.             picTwo.Image = Image.FromFile("D:\\CStutorial\\baydin\\back.png");
  65.             picOne.Image = Image.FromFile("D:\\CStutorial\\baydin\\back.png");
  66.             picOne.Enabled = false;
  67.             picTwo.Enabled = false;
  68.             picThree.Enabled = false;
  69.             txtBaydin.Text = "Fool, သင်ကံဆိုးနေသည်";
  70.         }
  71.  
  72.         private void btnReset_Click(object sender, EventArgs e)
  73.         {
  74.             picOne.Enabled = true;
  75.             picTwo.Enabled = true;
  76.             picThree.Enabled=true;
  77.        
  78.             picOne.Image = Image.FromFile("D:\\CStutorial\\baydin\\back.png");
  79.             picTwo.Image = Image.FromFile("D:\\CStutorial\\baydin\\back.png");
  80.             picThree.Image = Image.FromFile("D:\\CStutorial\\baydin\\back.png");
  81.  
  82.             txtBaydin.Clear();
  83.            // txtBaydin.Text = "";
  84.         }
  85.     }
  86. }
  87.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement