Users Pricing

forum

Home Forums How to get index value in combo box? – MindStick

How to get index value in combo box?

Anonymous User 2463 25 Jan 2014

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?


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md