ComboBox SelectedIndexChanged is an EventHandler: it is triggered/fired/invoked anytime the run-time user changes the Selected Item in a ComboBox. If you write this:
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
groupBox1.Visible = true;
}
Then, every time the user changes the Selected Item in the ComboBox, the GroupBox will have its Visible Property set to 'true. That's probably not what you want.
My guess is that you want the GroupBox made visible
only if one Item is selected in the ComboBox, and hidden if any other Item is selected.
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
groupBox1.Visible = comboBox1.SelectedIndex == 0;
switch (comboBox1.SelectedIndex)
{
case 0:
break;
case 1:
break;
}
}