|
|
Title | Use a checked ListBox |
Description | This example shows how to use a checked ListBox in Visual Basic 6. |
Keywords | ListBox, checked, checked list, checked ListBox |
Categories | Controls |
|
|
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
|
|
|
|
|
|