Groups | Blog | Home
all groups > vb.net controls > may 2004 >

vb.net controls : Checked Listbox Control


RBCC
5/8/2004 11:01:26 PM
When a user checks an item how do I get the string of the item checked?
elenaar NO[at]SPAM online.microsoft.com
5/10/2004 8:36:20 PM
You can use something like this:
' Visual Basic
' Determine if there are any items checked.
If CheckedListBox1.CheckedItems.Count <> 0 Then
' If so, loop through all checked items and print results.
Dim x As Integer
Dim s As String = ""
For x = 0 To CheckedListBox1.CheckedItems.Count - 1
s = s & "Checked Item " & (x + 1).ToString & " = " &
CheckedListBox1.CheckedItems(x).ToString & ControlChars.CrLf
Next x
MessageBox.Show(s)
End If


Saludos,

Elena Arzac
AddThis Social Bookmark Button