Solved

Combobox value property in visual basic 6

Posted on 2006-06-09
4
464 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 69

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to open Waze.com/livemap from address saved in DB? 26 177
bunnyEars challenge 6 99
python sqlite question 11 46
Currency Conversion? 1 71
This is an explanation of a simple data model to help parse a JSON feed
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

911 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

19 Experts available now in Live!

Get 1:1 Help Now