private void CityToolStripMenuItem_Click(object sender, EventArgs e) { City_Form cF = new City_Form(lastSelectedcomboBox_CityIndex); cF.StartPosition = FormStartPosition.CenterParent; cF.ShowDialog(); CityArrToForm(cF.SelectedCity); lastSelectedcomboBox_CityIndex = (comboBox_City.SelectedItem as City); }
private void comboBox_City_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox_City.SelectedItem != null) { if (comboBox_City.SelectedItem.ToString() == "+") { if (comboBox_City.Focused) { City_Form cF = new City_Form(lastSelectedcomboBox_CityIndex); cF.StartPosition = FormStartPosition.CenterParent; cF.ShowDialog(); CityArrToForm(cF.SelectedCity); } } lastSelectedcomboBox_CityIndex = (comboBox_City.SelectedItem as City); } }