Check one item in CheckedListbox
C#
3
Posts
2
Posters
0
Views
1
Watching
-
Hi, please help me out to check the CheckedListbox only one item at click, rest of the items should be unchecked.
-
It's easy : Use the event CheckedChanged then write this kind of code : Go to each item, checked whether the item is the item you just selected. If yes, then set the property "Checked" to true, otherwise false;
i found the solution , CheckedIndex is previously selected item index. private void chkProperties_ItemCheck(object sender, ItemCheckEventArgs e) { chkProperties.ItemCheck-=new ItemCheckEventHandler(chkProperties_ItemCheck); chkProperties.SetItemChecked(CheckedIndex,false); chkProperties.ItemCheck+=new ItemCheckEventHandler(chkProperties_ItemCheck); CheckedIndex=e.Index; }