Private Sub Form_Load()
Dim cnt As Long
For cnt = 1 To 10
List1.AddItem "Item " & cnt
Next
Command1.Caption = "Get selected items"
Command2.Caption = "Clear selection"
End Sub
Private Sub Command1_Click()
Dim cnt As Long
With List1
If .SelCount > 0 Then
For cnt = 0 To .ListCount - 1
If .Selected(cnt) = True Then
Debug.Print .List(cnt)
End If
Next
End If
End With
End Sub
Private Sub Command2_Click()
Dim cnt As Long
With List1
If .SelCount > 0 Then
For cnt = 0 To .ListCount - 1
.Selected(cnt) = False
Next
End If
End With
End Sub
--
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
"Maarten" <gu******@hotmail.com> wrote in message
news:41*********************@news.skynet.be...
: thank you for yourre quick reply,
: i did so (set the style property to checked)
: and it looks nice
:
: but do you mightbe have a litle example code how to work with te box in
the
: list?
:
: Kind regards Maarten
:
:
: "Maarten" <gu******@hotmail.com> wrote in message
: news:41*********************@news.skynet.be...
: > hi all
: >
: > i was wondering if it is posible to add checkboxe in a listbox
: > and if so how do i do it?
: >
: > thankyou
: >
: > Maarten
: >
: >
:
: