Getting an Integer Value from a Combobox and sharing it

Posted on 2009-04-16
Last Modified: 2013-11-26
In Visual Studio 2008 IDE, I need to take the selected value from a combobox that's in one class and pass it to a function in another class AS an integer. My Combobox has a list of options like:
LogLevel 1
LogLevel 2

All the documentation and examples I'm finding are using outdated VB6 code.
Question by:Syncer
    LVL 74

    Accepted Solution

    Class.FunctionName(MyComboBox.SelectedIndex + 1)

    does not work?
    LVL 48

    Expert Comment

    This is the values you have ?
    LogLevel 1
    LogLevel 2
    LogLevel 3
    Can they change it ? You can use something like:

    Dim intValue As Integer = Me.ComboBox1.Text.Substring(9).Trim

    Open in new window

    LVL 69

    Expert Comment

    by:Éric Moreau
    if you set the ValueMember of the combo, you should be able to retreive the value into the SelectValue property.

    How do you fill the Combo?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    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.

    Suggested Solutions

    Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (…
    How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from ( Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

    779 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

    14 Experts available now in Live!

    Get 1:1 Help Now