|
-
Aug 22nd, 2002, 01:22 PM
#1
Thread Starter
Junior Member
Listbox questions
I have a listbox that I fill with data from an array like this:
Code:
With Listbox1
For i = 0 To UBound(Kunder, 2)
.AddItem (Kunder(1, i) & " " & Kunder(2, i))
Next
End With
That works fine, but now to the problem, every "part" of the array has an number(identifier), Kunder(0, i) that I want to add as an index or something with the data so that when I click on a post in the listbox I can retriev the number for that post. How can I do that?
-
Aug 22nd, 2002, 01:35 PM
#2
PowerPoster
hi
Perphaops u r looking for:
Code:
With Listbox1
For i = 0 To UBound(Kunder, 2)
.AddItem (Kunder(1, i) & " " & Kunder(2, i))
.ItemData(.NewIndex) = Kunder(0, i)
Next
End With
-
Aug 22nd, 2002, 01:39 PM
#3
Thread Starter
Junior Member
Thanx, but what do I write to retrieve the number?
Code:
Private Sub Listbox1_Click()
MsgBox(Listbox1.???)
End Sub
-
Aug 22nd, 2002, 01:55 PM
#4
Fanatic Member
After you selecting an item in the list box:
VB Code:
MsgBox List1.ItemData(List1.ListIndex)
JO
"I have not failed. I've just found 10,000 ways that won't work."
'Thomas Edison'
"If we knew what it was we were doing it wouldn't be called research, would it?"
'Albert Einstein'
VB6
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|