Getting an Integer Value from a Combobox and sharing it

Posted on 2009-04-16
Medium Priority
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 75

Accepted Solution

käµfm³d   👽 earned 1500 total points
ID: 24161786
Class.FunctionName(MyComboBox.SelectedIndex + 1)

does not work?
LVL 48

Expert Comment

ID: 24161804
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 70

Expert Comment

by:Éric Moreau
ID: 24161967
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?

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

850 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