Populate and Remove items from a list box.
Populate and Remove items from a list box.
API Declarations
Set the listbox style property to 1 - Checkbox
Call the first command button cmdFill
Call the second command button cmdRemove
Rate Populate and Remove items from a list box.
(1(1 Vote))
Dim i As Integer
Private Sub cmdFill_Click()
For i = 1 To 20
List1.AddItem i
Next i
End Sub
Private Sub cmdRemove_Click()
Dim i As Integer
For i = List1.ListCount - 1 To 0 Step -1
If List1.Selected(i) = True Then
List1.RemoveItem (i)
End If
Next i
End Sub
Populate and Remove items from a list box. Comments
No comments yet — be the first to post one!
Post a Comment