How to loop through a checkboxlist and to find what's checked and not checked?

后端 未结 6 2174
-上瘾入骨i
-上瘾入骨i 2020-12-18 18:47

I\'m trying to loop through items of a checkbox list. If it\'s checked, I want to set a value. If not, I want to set another value. I was using the below, but it only gives

6条回答
  •  被撕碎了的回忆
    2020-12-18 19:30

    check it useing loop for each index in comboxlist.Items[i]

    bool CheckedOrUnchecked= comboxlist.CheckedItems.Contains(comboxlist.Items[0]);
    

    I think it solve your purpose

提交回复
热议问题