Advertisement
DrAungWinHtut

UItest CS

Mar 7th, 2022
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.05 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 _2022030201_CS_Array_Tutorial
  12. {
  13.     public partial class frmUItest : Form
  14.     {
  15.         public frmUItest()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void frmUItest_Load(object sender, EventArgs e)
  21.         {
  22.             cboCities.Items.Add("NayPyiDaw");
  23.             cboCities.Items.Add("Pegu");
  24.         }
  25.  
  26.         private void btnAddCity_Click(object sender, EventArgs e)
  27.         {
  28.             string sCity = txtCity .Text;
  29.             cboCities .Items.Add(sCity);
  30.         }
  31.  
  32.         private void cboCities_SelectedIndexChanged(object sender, EventArgs e)
  33.         {
  34.             MessageBox.Show(cboCities.SelectedIndex.ToString());
  35.             if(cboCities.SelectedItem .ToString () == "Yangon")
  36.             {
  37.                 this.Text = "Yangon";
  38.             }
  39.         }
  40.     }
  41. }
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement