Phreak Posted April 9, 2003 Posted April 9, 2003 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): 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? Quote If it works... don't worry, I'll fix it.
*Experts* Volte Posted April 9, 2003 *Experts* Posted April 9, 2003 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. Quote
Phreak Posted April 10, 2003 Author Posted April 10, 2003 That worked great... thanks! Quote If it works... don't worry, I'll fix it.
Moderators Robby Posted April 10, 2003 Moderators Posted April 10, 2003 Ahh, I see my list of countries being put to good use. :) Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.