-
I have a combo box with a whole bunch of items, that look like this.
(Data, Label)
(1,A)
(2,B)
(3,C)
(4,D)
How do I make it start with (2,B) selected?
Thanks,
Rachel
-
Senior Member
try
Code:
myComboBox.setSelectedIndex(1);
-
Originally posted by chi-styler
try
Code:
myComboBox.setSelectedIndex(1);
Thanks, but how do I dynamically assign it? I want to be able to pass in either 1 or B, and have it find the index.
-
Senior Member
Then you're going to have to loop through your combobox data and label array until you find the required item, and then keep the index
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|