|
-
October 12th, 2003, 07:41 PM
#1
Listing Multiselected Items from a Listbox..
Hello,
I made a listbox, checkbox style and....
For i = 0 To lstTest.ListCount - 1
If lstTest.Selected(i) Then
MsgBox lstTest.List(i)
End If
Next i
I found a way to show all the people I selected from a list box...through a message box. Let's pretend it's a list of people....
How would I grab from the listbox, say the names in the list are "joe shmo" and "britney spears" which are the ones I selected and then assign each one to it's own variable? (Maybe a string variable)?
Thanks.
-
October 12th, 2003, 07:56 PM
#2
Code:
Dim MyArray() as string
dim Max as Integer
For i = 0 To lstTest.ListCount - 1
If lstTest.Selected(i) Then
Max = ubound(MyArray) + 1
Redim Preserve MyArray(Max)
MyArray(Max) = lstTest.List(i)
End If
Next i
NOTE: If you use Redim without Preserve, you will lose whatever's already in the array.
Be nice to Harley riders...
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
|