Posted on 2005-05-05
Last Modified: 2010-04-23
In VB.NET 2003, if I have a ComboBox populated with a couple of items, and I want to programatically display a certain item, say item number 3, how do I do that?
Question by:SETP
    LVL 48

    Accepted Solution

    comboBox1.SelectedItem = 3;

    (or 2 - items index is 0-based).

    Author Comment

    Actually, I was also trying that but it wasn'y working. Then I figured it out, it's

    combobox1.SelectedIndex = 2, not

    But I'll give you the points anyway for the help. Thanks AlexFM
    LVL 48

    Expert Comment

    Damn, I wanted to write SelectedIndex but copied from the wrong place. I must read my posts before clicking Submit :-(

    Author Comment

    Don't worry about it. Happened to me in the past too! Thanks for your support anyways.


    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Article by: Kraeven
    Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
    The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now