Form5.cs 742 B

1234567891011121314151617181920212223242526272829303132
  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. namespace WindowsFormsApp19
  11. {
  12. public partial class Form5 : Form
  13. {
  14. public Form5()
  15. {
  16. InitializeComponent();
  17. }
  18. private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
  19. {
  20. string selectedCountry = listBox1.SelectedItem.ToString();
  21. MessageBox.Show(selectedCountry);
  22. }
  23. private void button2_Click(object sender, EventArgs e)
  24. {
  25. Form6 frm6 = new Form6();
  26. frm6.Show();
  27. }
  28. }
  29. }