Results 1 to 2 of 2

Thread: ListBox Help

  1. #1
    Deathfrog
    Guest

    ListBox Help

    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

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    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
    Mark
    -------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width