Search code examples
c#winformscheckedlistbox

How to check an item in an CheckedListBox from code behind


I have a CheckedListBox that contains 3 values which are added manually and not from code behind.

This is how the CheckedListBox looks like:

enter image description here

I would like to add that these values are always the same in the same order, they never change.

This is my question:

  • Is possible to access these values from code behind so I can check them?

Solution

  • CheckedListBox in winforms has various properties - Items, CheckedItems, CheckedIndices for maniuplating it from the C# side.

    You can check them by calling SetItemChecked.