您的位置:首页 > 其它

checkedListBox

2015-07-25 22:18 309 查看
checkedListBox一键删除多个选中items

private void button3_Click(object sender, EventArgs e)
{
for (int i = 0; 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 = 0; i < checkedListBox1.Items.Count; i++)
{
if (checkedListBox1.GetItemChecked(i))
{
checkedListBox1.SetItemChecked(i, false);
}
else
{
checkedListBox1.SetItemChecked(i, true);
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: