Checked List Box check in program

R

Rick

VB.Net 2005

I would like to programatically check the check box in a CheckedListBox
control.

I don't see any examples in the help and have not googled up anything
either.

How do I do this?

Rick
 
M

maligui

I would enumerate through the checked items of the listbox

'To check by items
Dim o As Object
For Each o In Me.CheckedListBox1.CheckedItems
'Stuff to do

'Prints the item text that are checked
Console.WriteLine(o)
Next

'By Index
Dim i As Integer
For Each i In Me.CheckedListBox1.CheckedIndices
'Stuff to do

Console.WriteLine(i)
Next
 
R

Rick

I found it. CheckedListBox.SetItemChecked

For some reason it did not show up in InteliSense and I could not get
answers in Google until I searched in this newsgroup.

Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top