1、 给checkedListBoxControl绑定数据源:

            checkedListBoxControl.DataSource = listRole;
            checkedListBoxControl.DisplayMember = "roleName";
            checkedListBoxControl.ValueMember = "ID"; 

      2、打钩checkedListBoxControl控件里的某一项:

           checkedListBoxControlRole.SetItemChecked(i, true); //i是控件的索引值

      3、获取checkedListBoxControl控件里某一项的ValueMember值

           checkedListBoxControlRole.GetItemValue(i).ToString();//i是控件的索引值

    4、实现checkedListBoxControl控件点击一次就可以选中复选框,设置CheckOnClick属性为true,即可。

       

相关文章:

  • 2022-12-23
  • 2022-02-25
  • 2022-12-23
  • 2022-12-23
  • 2021-05-09
  • 2021-11-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2021-05-11
  • 2022-12-23
相关资源
相似解决方案