Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Combobox value property in visual basic 6

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
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…
Progress

722 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