mercredi 18 mars 2020

How to check all items in CheckedListBox with vertical scroll bar with one click?

I have a CheckedListBox on my form with 13 items but it shows only 8 you need to use a vertical scroll bar to see the other 5 checkboxes. The first item is "" if I check this, all other checkboxes which are shown at the moment will be checked, but the other 5 checkboxes won't be checked.

I use this code to check all checkboxes:

if (WochenTage_chbl.GetItemChecked(0))
{
     for (int i = 0; i < WochenTage_chbl.Items.Count; i++)
     {
        WochenTage_chbl.SetItemChecked(i, true);
     }
}

Do you know why only the shown checkboxes were checked?




Aucun commentaire:

Enregistrer un commentaire