Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Combobox value property in visual basic 6

Posted on 2006-06-09
4
Medium Priority
?
495 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
  • 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 250 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Introduction to Processes

916 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