I have a ComboBox setup with 4 items, with indexes ranging from 0 to 3.
Later in my code, I need to do a certain event depending on what is selected. To do this I thought about comparing what the index of the selected ComboBox item is, because integer comparison is faster than strings, right?
How can I get the index of the selected item?
ComboBox has a SelectedIndex property.
Regarding comparison:
If you’re not doing millions of comparisons then this “optimization” wouldn’t help you.