C#winform listView CheckBoxes 全选,反选怎么做

2025-02-26 14:21:19
推荐回答(1个)
回答1:

for (int i = 0; i < checkedListBox1.Items .Count; i++)
{
checkedListBox1.SetItemChecked(i, true);
}

全不选

for (int i = 0; i < checkedListBox1.Items .Count; i++)
{
checkedListBox1.SetItemChecked(i, false);
}