checkedListBox

checkedListBox一键删除多个选中items

 private void button3_Click(object sender, EventArgs e)
{
for (int i = ; i < checkedListBox1.Items.Count; i++)
{
if (checkedListBox1.GetItemChecked(i))
{
checkedListBox1.Items.RemoveAt(i);
i--;
}
}

checkedListBox反选

 private void button11_Click(object sender, EventArgs e)
{
for (int i = ; i < checkedListBox1.Items.Count; i++)
{
if (checkedListBox1.GetItemChecked(i))
{
checkedListBox1.SetItemChecked(i, false);
}
else
{
checkedListBox1.SetItemChecked(i, true);
}
}
}
上一篇:Java String,StringBuffer和StringBuilder的区别


下一篇:删除.gitignore中的在version control中的文件