Page 1 of 1

Question about using ComboBox

Posted: Tue Nov 29, 2005 04:42
by kungfoomasta
In my program I'm using several comboboxes, and they each have about 5 items in them. My question is, is there a function, or what do I do, to make it so that a particular item is selected by default?

Say I have Combobox b. b has 5 items:
item1/item2/item3/item4/item5

I want my program to start up with item4 selected from the box. It won't always be item4 that is the default, so I don't want to hardcode the 4th item as the text of the box.
( don't want to do this: b->setText("Item4") )

Also, I tried using the "setItemSelectState(...)" function, and my program crashed. How is that function supposed to be used?

I did setItemSelectState((uint)0,true) and it crashed.

Thanks