Advertisement
DrAungWinHtut

baydi1

Feb 10th, 2022
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.39 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 _2022021001BasicTools
  12. {
  13.     public partial class frmMain : Form
  14.     {
  15.         public frmMain()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void picBaydin_Click(object sender, EventArgs e)
  21.         {
  22.             Random rnd = new Random(); //random object
  23.             int ans = rnd.Next(1, 4);
  24.             txtAns.Text = ans.ToString();
  25.  
  26.             if(ans==1)
  27.             {
  28.                 picBaydin.Image = Image.FromFile("D:\\CStutorial\\baydin\\1.jpg");
  29.                 txtBaydin.Text = "ဒီ​နေ့ ကံကောင်းနေတယ်";
  30.             }
  31.             else if(ans==2)
  32.             {
  33.                 picBaydin.Image = Image.FromFile("D:\\CStutorial\\baydin\\2.jpg");
  34.                 txtBaydin.Text = "ဒီ​နေ့ ကံမကောင်းပါ";
  35.             }
  36.             else
  37.             {
  38.                 picBaydin.Image = Image.FromFile("D:\\CStutorial\\baydin\\3.jpg");
  39.                 txtBaydin.Text = "ဒီ​နေ့ ထူးခြားမှု မရှိပါ";
  40.             }
  41.         }
  42.  
  43.         private void frmMain_Load(object sender, EventArgs e)
  44.         {
  45.  
  46.         }
  47.     }
  48. }
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement