private void Validationbtn_Click(object sender, EventArgs e) { realpl = (int)nudRealPlayer.Value; coops = (int)nudCoOps.Value; if (realpl + coops < 2) { MessageBox.Show("please make sure that here are at least 2 players"); } else { formdata.setValues(realpl, coops); this.Close(); } }
/****************************** * Methods *******************************/ private void button1_Click(object sender, EventArgs e) { string text = (string)cbxPossibilities.SelectedItem; foreach (KeyValuePair <string, int> option in enums) { if (option.Key == text) { data.setValues(option.Value); } } this.Close(); }