S
S
swyt2020-05-31 10:56:00
C++ / C#
swyt, 2020-05-31 10:56:00

Why doesn't the button to check if the combobox is full work?

private void button1_Click(object sender, EventArgs e)
        {
            if (comboBox2.SelectedIndex < 0 )
            {
                button1.Enabled = false;
            }
            else 
            {
                button1.Enabled = true;
            }

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
bitddeveloper, 2020-05-31
@bitddeveloper

SelectedIndex cannot be less than 0

D
d-stream, 2020-05-31
@d-stream

Give a man a fish - he will be full for one day, give a fishing rod - ... although it may break)
We put a breakpoint on the check and press the button.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question