Hi there guys I need some help I can't seem to remove the checks in the check list boxes i used checklistbox1.clearselected(); for my reset button but it didn't work. It does not remove the checks inside the boxes. I have an attachment you can use as your reference. Thank you for those who will help.

Recommended Answers

All 2 Replies

foreach (int item in checkedListBox1.CheckedIndices) {
    checkedListBox1.SetItemCheckState(item, CheckState.Unchecked);
}

Selected and Checked are two different states so that is why your code doesn't work. There isn't an easier way.

foreach (int item in checkedListBox1.CheckedIndices) {
    checkedListBox1.SetItemCheckState(item, CheckState.Unchecked);
}

Selected and Checked are two different states so that is why your code doesn't work. There isn't an easier way.

Thank you very much sir, it is now working! Thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.