code_junkie

How do I get the value (not check or unchecked) of a checkboxlist

Nov 13th, 2011
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. for (int i = 0; i < clbIncludes.Items.Count; i++)
  2.  
  3. if (clbIncludes.GetItemCheckState(i) == CheckState.Checked)
  4. {
  5. //need the values of the checked checkbox here
  6. }");
  7.  
  8. foreach(object itemChecked in checkedListBox1.CheckedItems)
  9. {
  10. MyItem item = itemChecked as MyItem;
  11.  
  12. if (item != null)
  13. {
  14. // use item...
  15. }
  16. }
Add Comment
Please, Sign In to add comment