Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace WindowsFormsApp1
- {
- public partial class Form1 : Form
- {
- Global globals = new Global();
- public Form1()
- {
- InitializeComponent();
- comboBox1.Items.Add("Tim 1");
- comboBox1.Items.Add("Tim 2");
- comboBox1.Items.Add("Tim 3");
- comboBox1.SelectedIndex = 0;
- comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
- }
- private void button1_Click(object sender, EventArgs e)
- {
- listBox1.Items.Clear();
- string[] temp = new string[10];
- if (comboBox1.SelectedIndex == 0)
- {
- globals.team1 = string.Concat(textBox1.Text + ";");
- temp = globals.team1.Split(';');
- }
- if (comboBox1.SelectedIndex == 1)
- {
- globals.team2 += textBox1.Text + ";";
- temp = globals.team2.Split(';');
- }
- if (comboBox1.SelectedIndex == 2)
- {
- globals.team3 += textBox1.Text + ";";
- temp = globals.team3.Split(';');
- }
- listBox1.Items.Add(globals.team1);
- //for (int i = 0; i < temp.Length; i++) listBox1.Items.Add(temp[i]);
- }
- class Global
- {
- public string team1;
- public string team2;
- public string team3;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement