Andrew Ducker Andrew Ducker -3 years ago 126
C# Question

How do I programmatically check an item in a checkedlistbox in c#

I have a checkedlistbox and I want to automatically tick one of the items in it.

The CheckedItems collection doesn't allow you to add things to it.

Any suggestions?

Answer Source

You need to call SetItemChecked with the relevant item.

The documentation for CheckedListBox.ObjectCollection has an example which checks every other item in a collection.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download