I have a ComboBox with two values 'cash' and 'bank' if the user selects bank I need to enable two controls. I've tried below code:
private void comboBopay_type_SelectedIndexChanged(object sender, EventArgs e)
{
if (comboBobank.SelectedIndex == 1)
{
comboBobank.Enabled = true;
textBorecp_no.Enabled = true;
}
}
Problem is the index value is -1 for both cash and bank. Where have I made an error?
Pravesh Singh
25-Jan-2014You're just referencing the wrong combo box:
You need to reference comboBopay here.