I have an array of structs and each struct contains values for the checkboxes. I am trying to display the checkbox values contained within a particular struct.
MyStruct is an array of structs which has a values for the checkboxes
ChkBoxCol is the collection of check boxes for the form.
I am iterating through the collection as follows:
What I am noticing is that if the check boxes are checked in order (checkbox 1, 2, 3, 4...etc) the code works fine and the values are displayed correctly in the form. However, if the check boxes are not checked in order (4, 5, 7...etc) the code does not write the values of the check boxes and instead keeps them blank.Code:For Each ctrl In ChkBoxCol If MyStruct(index).ChkBoxArray(pos) = True Then CType(ctrl, CheckBox).Checked = True pos = pos + 1 End If Next
I just need to display the values for the check boxes for a specific struct.