Solved

Combobox value property in visual basic 6

Posted on 2006-06-09
4
488 Views
Last Modified: 2008-01-09

There is a facility in ASP,ASP.NET that, we can put the combobox with Text Parameter which is shown at front and with Value parameter behind it.

Is there any combobox available in visual studio 6 with both value parameter and text parameter differently ?
0
Comment
Question by:sandip_patel7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Expert Comment

by:List244
ID: 16871735
I might be slightly off on what you are asking, but:

The value in a combobox is stored in the index value.  The first item is 0 then 1 then 2... etc..
You can grab the value of the combo box by seeing what the index is IE:

Combo1.listindex would be the value selected.

Then you can get the text by doing:

Combo1.List(Combo1.listindex)  That gets the value associated with that index.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 16871741
Hi sandip_patel7,

> Is there any combobox available in visual studio 6 with both value
> parameter and text parameter differently ?

if your value is numeric, you can store into the ItemData property.

Cheers!
0
 

Author Comment

by:sandip_patel7
ID: 16871799
No At behind Value can be anything, it can be text or numeric
e.g.
NJ - New Jersey
NY - New York
FL - Florida
AZ - Arizona

I should get value "NY" when I select the option
"New York" , not the index  " 1 "

Is this possible ?
0
 
LVL 8

Accepted Solution

by:
List244 earned 125 total points
ID: 16871824
You could create an array to accompany the combo box and store the values in that in-line with the combo values.
So Array(0) could be a match to Combo1.list(0)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A short article about a problem I had getting the GPS LocationListener working.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

739 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