0

HI friends,
Is there a possibility to refer to item by its number (in Combobox)?

For example, I read all combobox items from a file.
and I need to do sth like that:

if (comboBox1->Itemnumber=1) then {Action}

I don't want to refer to the text in the combobox to make a condition.

thx for help!

2
Contributors
4
Replies
6
Views
7 Years
Discussion Span
Last Post by VasquezPL
0

comboBox1->SelectedIndex will give you the zero-based index of the item you've selected. Probably you were just in a rush, but you want the == instead of = in your line of code above.

0

Yeah thats exactly what I was looking for :)
thx mate once again!.

0

No prob. If you haven't been over to MSDN you should check it out as there's every little detail of .NET mapped out (not that I mind answering your questions at all).

0

Yeah I have found it, but you were faster with your answer
so I couldnt close the thread before..
MSDN is a first place I start searching :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.