码迷,mamicode.com
首页 > Windows程序 > 详细

winform CheckedListBox实现全选/全不选

时间:2015-01-15 19:51:09      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:

/全选
        private void button3_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < this.checkedListBox1.Items.Count; i++)
            {
                this.checkedListBox1.SetItemChecked(i, true);
            }
 
}
        //反选
        private void button4_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);
                }
            }

winform CheckedListBox实现全选/全不选

标签:

原文地址:http://www.cnblogs.com/zhangruisoldier/p/4227020.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!