By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,198 Members | 1,721 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,198 IT Pros & Developers. It's quick & easy.

Checked List Box check in program

P: n/a
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
Oct 18 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
Oct 19 '06 #2

P: n/a
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

"Rick" <Ri**@LakeValleySeed.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
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

Oct 19 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.