-
I have a list box with a bunch of things in it, im using checkbox style and multiselect how can i get vb to return the selected items to me?
ex: in a listbox we have this
apple
orange
bananna
pear
the user selects pear and apple
i want to be able to click a button and have it say
apple; pear or anythign that has the selected items in it
-
Dim i As Integer
For i = 0 To List1.ListCount - 1
If List1.Selected(i) Then
MsgBox List1.List(i) & " is selected"
End If
Next i
-
something like this..
Hi!
Code:
Private Sub Command1_Click()
Dim selectedthings As String
For i = 0 To List1.ListCount - 1
If List1.Selected(i) = True Then
selectedthings = selectedthings & List1.List(i) & vbNewLine
End If
Next
MsgBox "Selected Items are " & vbnewline & selectedthings
End Sub
Does that help u?
Jeba.
[Edited by jeba on 06-20-2000 at 01:59 AM]