Creating an invisible column in a combobox in eVB

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

irosen516

Thread Starter
Joined
Dec 9, 2002
Messages
23
Hi there. I'm remembering back to my days working with Access and remember being able to create a combobox with two columns where I could have one column be invisible and then stored that value in a database, etc. I would like to do the same thing in eVB. Does anyone know if there is a way to do that? I found something about CBS_EX_CONSTSTRINGDATA, but can't find too much information about it or how to use it. Thanks.
 
Joined
Oct 10, 2001
Messages
186
The eVB combo box like the VB combo box doesn't allow multiple columns like the MS Forms combo box in Access. It does have an ItemData property for each item:
Code:
Private Sub Combo1_Click()
    MSgbox Combo1.ItemData(Combo1.ListIndex)
End Sub

Private Sub Form_Load()
    For i = 1 To 10
        Combo1.AddItem "Item " & CStr(i)
        Combo1.ItemData(Combo1.NewIndex) = 100 * i
    Next
End Sub
Unfortunately you can only use it to store values of the Long datatype and not strings but this could be used as a pointer to an associated array of other elements.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top