19
Answers

Having to click twice the close button to close a form

Mario Cuervo

Mario Cuervo

10y
3k
1
I have the following code attached to SelectedIndexChange event of comoBox5:
 
private void comboBox5_SelectedIndexChanged(object sender, EventArgs e)
{
     _selectedValue = (int) comboBox5.SelectedValue;
     textBox1.Text = _selectedValue.ToString();
}
 
which works fine, except that it has a non desire side effect. When ever such code is active you will need to click twice the close button of the form (X) in order to close it.  Any ideas on how to avoid this side effect??
 
Answers (19)