Hey, everyone knows me for stupid questions, so here's annother one, does anyone know how to find out how many items are listed in a list box? + how to associate that with the listindex function? thank you's
Eliot Lyons, Archarzel
Printable View
Hey, everyone knows me for stupid questions, so here's annother one, does anyone know how to find out how many items are listed in a list box? + how to associate that with the listindex function? thank you's
Eliot Lyons, Archarzel
Code:Option Explicit
Private Sub Command1_Click()
MsgBox "there are " & List1.ListCount & " items in the listbox"
MsgBox List1.List(List1.ListIndex) 'the currently selected item
End Sub
Private Sub Form_Load()
Dim i As Integer
For i = 0 To 10
List1.AddItem "item " & i
Next i
End Sub