I’m trying to write a switch statement that would have a similar effect to what I show in the code below, but (obviously), it’s not working. It will be impossible to have something selected in both combo boxes at once. Any thoughts on how to accomplish this? I’m updating an older program, and I’m trying not to re-write a large chunk of the code.
switch ((cboMAIN.SelectedIndex) || (cboMAINalternate.SelectedIndex))
{
case 0:
OutputString1 = "A";
break;
case 1:
OutputString1 = "C";
break;
case 2:
OutputString1 = "E";
break;
case 3:
OutputString1 = "F";
break;
case 4:
OutputString1 = "I";
break;
case 5:
OutputString1 = "J";
break;
case 6:
OutputString1 = "K";
break;
}
Try using