Solved

Combobox value property in visual basic 6

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
scores100 challenge 3 83
wordsWithoutList  challenge 24 75
strCopies  challenge 17 73
Image decoding from Camera 3 45
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This is about my first experience with programming Arduino.
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…

760 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