How to get value (do not check or mark) in checkboxlist

I am working on a winform application and go through a checkbox to see what has been checked. If it is checked, I need to know that this value is a member or value because I assigned it when I bound the checkbox list.

How can I get it?

Here's what I have now:

             for (int i = 0; i < clbIncludes.Items.Count; i++)

                if (clbIncludes.GetItemCheckState(i) == CheckState.Checked)
                {
                    //need the values of the checked checkbox here
                }");

      

+1


source to share


1 answer


foreach(object itemChecked in checkedListBox1.CheckedItems)
{
    MyItem item = itemChecked as MyItem;

    if (item != null)
    {
       // use item...
    } 
}

      



MSDN Link .

+2


source







All Articles