zoukankan      html  css  js  c++  java
  • [转载]C# 多选功能(checkedListBox控件)

         // 全选;
            private void btn_allSelected_Click(object sender, EventArgs e)
            {
                //this.CheckedListBox1.CheckOnClick = true;
                for (int i = 0; i < this.checkedListBox1.Items.Count; i++)
                {
                    this.checkedListBox1.SetItemChecked(i, true);
                }
            }
            // 全消;
            private void btn_allCancle_Click(object sender, EventArgs e)
            {
                for (int i = 0; i < this.checkedListBox1.Items.Count; i++)
                {
                    this.checkedListBox1.SetItemChecked(i, false);
                }
            }
            // 反选
            private void btn_Unselected_Click(object sender, EventArgs e)
            {
                for (int i = 0; i < this.checkedListBox1.Items.Count; i++)
                {
                    if (checkedListBox1.GetItemChecked(i))
                    {
                        this.checkedListBox1.SetItemChecked(i, false);
                    }
                    else
                    {
                        this.checkedListBox1.SetItemChecked(i, true);         
                    }         
                  
                }
            }
  • 相关阅读:
    位运算
    方法重载
    基本数据类型与引用数据类型参数
    带返回值方法的定义格式
    return使用
    方法的通用格式
    方法定义的格式
    google chrome developer tools
    Skolelinux
    ajax
  • 原文地址:https://www.cnblogs.com/iack/p/3538225.html
Copyright © 2011-2022 走看看