Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

If it works... don't worry, I'll fix it.
  • *Experts*
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...