日期:2014-05-18  浏览次数:20951 次

请问,如何取消checkedListBox的所有项的勾选状态
请问,如何取消checkedListBox的所有项的勾选状态


郁闷,这个方法都没找到

------解决方案--------------------
for (int i = 0; i < checkedListBox1.Items.Count;i++)
checkedListBox1.SetItemChecked(i, false);
------解决方案--------------------
C# code
int[] indexs = new int[checkedListBox1.CheckedIndices.Count];
checkedListBox1.CheckedIndices.CopyTo(indexs, 0);
Array.ForEach(indexs, v1 => checkedListBox1.SetItemChecked(v1, false));

------解决方案--------------------
C# code
foreach (int item in checkedListBox1.CheckedIndices)
{
    checkedListBox1.SetItemChecked(item, false);
}