Hi,
I have a problem with CheckedListBoxes that is confusing me.
This is the code I have in the constructor, where the designer code just adds the checkedlistbox:
I have tried refreshing the checkedListBox and hiding and showing between this code, but whenever the form comes up, none of the checked boxes are checked.
By stepping through the for loop all the items are being checked as it goes, so why are they not being show to be checked?
Thanks,
Dan
I have a problem with CheckedListBoxes that is confusing me.
This is the code I have in the constructor, where the designer code just adds the checkedlistbox:
Code:
InitializeComponent();
array2 = (ArrayList) array.Clone();
this.checkedListBox1.DataSource = array2;
this.checkedListBox1.CheckOnClick = true;
for (int i = 0; i < this.checkedListBox1.Items.Count; i++)
{
this.checkedListBox1.SetItemChecked(i, true);
}
I have tried refreshing the checkedListBox and hiding and showing between this code, but whenever the form comes up, none of the checked boxes are checked.
By stepping through the for loop all the items are being checked as it goes, so why are they not being show to be checked?
Thanks,
Dan