ComboBox.SelectionStart

Phreak

Regular
Joined
Jun 7, 2002
Messages
62
Location
Iowa, United States
Ok, this is REALLY starting to frustrate me. I have a collection list that contains all 237 countries starting at 0 through 236. I also have a For loopthat fills a combo box with this collection list. Now, all of this is done on the form load event, and I want the default selected start item to be the United States, which has an index of 222 in the combox (after it's filled) and 223 in the collection list.

Here is the code (without the list of countries):
Visual Basic:
For i = 1 To cCountries.Count Step 1
            cmbCountry.Items.Add(cCountries.Item(i))
        Next

        cmbCountry.SelectionStart = 222

No matter what I do, the drop down combo box never has a default item selected, it's always blank. Any ideas what I'm doing wrong?
 
Just set the Text property of the Combo Box to 'United States' or whatever
it is. Make sure that it is exactly the way that it is in the list.
 
Back
Top