Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo/List box with 2 columns!

Status
Not open for further replies.

bigfoot

Programmer
May 4, 1999
1,779
US
Combo/List box with 2 columns!

There is another property of the combo called .ItemData.

It is an array of long integer values with the same number of items as a list/combo control's List property.
You can use the numbers associated with each item to identify the items in a list or combo box.
For example, you can use an employee's identification number to identify each employee name in a ListBox control.

cboMine.AddItem sText
cboMine.ItemData(cboMine.NewIndex) = lData

you can write a small routine to access both pices just like a collection.

cboMine.AddData sText,lData

wow! this works too nice. The only problem is displaying them, and of course if you need 2 columns of text. There's all kinds of code around to do the display portion.

I hope this helps anyone looking for a visual dictionary control.

P.S. If anyone's interested, I have the full code for displaying and getting all in a class.

Gary
The door to life is never locked, but few have the knowledge to open it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top