Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleUse a checked ListBox
DescriptionThis example shows how to use a checked ListBox in Visual Basic 6.
KeywordsListBox, checked, checked list, checked ListBox
CategoriesControls
 
At design time, set the ListBox control's Style property to Checkbox.

When you click the form's OK button, the following code lists the selected items in the Debug window.

 
Private Sub Command1_Click()
Dim i As Integer

    Debug.Print "Selected items:"
    For i = 0 To List1.ListCount - 1
        If List1.Selected(i) Then Debug.Print Space$(4) & _
            List1.List(i)
    Next i
End Sub
 
 
Copyright © 1997-2006 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated