checkedListBox

 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);
                    }
                }
            }

 

posted @ 2015-07-25 22:18  SaYes  阅读(278)  评论(0编辑  收藏  举报