Advertisement
Levi0227

SuperBowl-WinForm-2022maj

Apr 22nd, 2023 (edited)
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.19 KB | Source Code | 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 WindowsFormsApp1
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void Form1_Load(object sender, EventArgs e)
  21.         {
  22.             arab_textBox2.Enabled = false;
  23.         }
  24.  
  25.         private void arrow_Button_Click(object sender, EventArgs e)
  26.         {
  27.             if (arrow_Button.Text=="--->")
  28.             {
  29.                 arrow_Button.Text = "<---";
  30.                 romai_textBox1.Enabled = false;
  31.                 arab_textBox2.Enabled = true;
  32.                 romai_textBox1.Text = "";
  33.                 arab_textBox2.Text = "";
  34.             }
  35.             else if (arrow_Button.Text=="<---")
  36.             {
  37.                 arrow_Button.Text = "--->";
  38.                 romai_textBox1.Enabled = true;
  39.                 arab_textBox2.Enabled = false;
  40.                 romai_textBox1.Text = "";
  41.                 arab_textBox2.Text = "";
  42.             }
  43.         }
  44.  
  45.         private void atvalt_Button_Click(object sender, EventArgs e)
  46.         {
  47.             if (arab_textBox2.Text == "")
  48.             {
  49.                 switch (romai_textBox1.Text.ToUpper())
  50.                 {
  51.                     case "I":
  52.                         arab_textBox2.Text = 1.ToString();
  53.                         break;
  54.                     case "II":
  55.                         arab_textBox2.Text = 2.ToString();
  56.                         break;
  57.                     case "III":
  58.                         arab_textBox2.Text = 3.ToString();
  59.                         break;
  60.                     case "IV":
  61.                         arab_textBox2.Text = 4.ToString();
  62.                         break;
  63.                     case "V":
  64.                         arab_textBox2.Text = 5.ToString();
  65.                         break;
  66.                     case "VI":
  67.                         arab_textBox2.Text = 6.ToString();
  68.                         break;
  69.                     case "VII":
  70.                         arab_textBox2.Text = 7.ToString();
  71.                         break;
  72.                     case "VIII":
  73.                         arab_textBox2.Text = 8.ToString();
  74.                         break;
  75.                     case "IX":
  76.                         arab_textBox2.Text = 9.ToString();
  77.                         break;
  78.                     case "X":
  79.                         arab_textBox2.Text = 10.ToString();
  80.                         break;
  81.                     default:
  82.                         arab_textBox2.Text = ("Hiba!");
  83.                         break;
  84.                 }
  85.             }
  86.             else if(romai_textBox1.Text=="")
  87.             {
  88.                 switch (arab_textBox2.Text)
  89.                 {
  90.                     case "1":
  91.                         romai_textBox1.Text = "I";
  92.                         break;
  93.                     case "2":
  94.                         romai_textBox1.Text = "II";
  95.                         break;
  96.                     case "3":
  97.                         romai_textBox1.Text = "III";
  98.                         break;
  99.                     case "4":
  100.                         romai_textBox1.Text = "IV";
  101.                         break;
  102.                     case "5":
  103.                         romai_textBox1.Text = "V";
  104.                         break;
  105.                     case "6":
  106.                         romai_textBox1.Text = "VI";
  107.                         break;
  108.                     case "7":
  109.                         romai_textBox1.Text = "VII";
  110.                         break;
  111.                     case "8":
  112.                         romai_textBox1.Text = "VIII";
  113.                         break;
  114.                     case "9":
  115.                         romai_textBox1.Text = "IX";
  116.                         break;
  117.                     case "10":
  118.                         romai_textBox1.Text = "X";
  119.                         break;
  120.                     default:
  121.                         romai_textBox1.Text = ("Hiba!");
  122.                         break;
  123.                 }
  124.             }
  125.  
  126.         }
  127.     }
  128. }
  129.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement