我用的是winform给一张卡片授权我用的是checkboxlist选中某些权限添加, 我想在点击这个授权的卡要显示以前授权过的信息值,也就是在checkboxlist中的值为选中状态。这个 checkboxlist中的selected  在winform 中 貌似没有。?
请教了。   谢谢。

解决方案 »

  1.   

    CheckedListBox
    checkedListBox1.SetItemChecked(0, true);
      

  2.   

    人生如梦,人们因为 贪嗔痴 而迷失自己的本性,沉沦于六道轮回而不能觉之,犹如生活在梦中。
    wuyq11 能有如此的 人生感叹,这世间像 他这样的人真是难得有。
      

  3.   

                checkedListBox1.Items.AddRange(new string[] { "one", "two", "three","four" });
                checkedListBox1.SetItemChecked(0, true);
                checkedListBox1.SetItemCheckState(1, CheckState.Indeterminate);
                checkedListBox1.SetItemCheckState(2, CheckState.Unchecked);            if (checkedListBox1.GetItemChecked(0))
                {
                    Console.WriteLine("checkedListBox1 one  checked.");
                }            if (checkedListBox1.GetItemCheckState(1) == CheckState.Indeterminate)
                {
                    Console.WriteLine("checkedListBox1 two CheckState is Indeterminate");
                }
      

  4.   

    标准解答:
    CheckedListBox
    checkedListBox1.SetItemChecked(i, true); 
    i是获取你选中值的索引