Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void button1_Click(object sender, EventArgs e)
- {
- listBox1.Items.Add(textBox1.Text);
- textBox1.Text = "";
- }
- private void button2_Click(object sender, EventArgs e)
- {
- string s = "";
- foreach(var c in listBox1.SelectedItems)
- {
- if(int.TryParse(c.ToString(), out int o))
- {
- if(o%2 == 0)
- {
- s += $"{o.ToString()}\n";
- }
- }
- }
- MessageBox.Show(s);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement