brett_eden
New member
In the interest of keeping my code compact and easy to maintain, I need some advice on how to group controls (in this case, checkboxes) and change their state without having to make a specific reference to each control.
I have:
chkMelbourne
chkPerth
chkAdelaide
chkBrisbane
chkHobart
chkDarwin
chkSydney
I need to alter their Enabled property based on the state of other checkboxes in my application, but would rather reference them in a group as opposed to individually. Some are enabled, some arent. The longhand way (if constructs and select case clauses)are making the code far too verbose. :-(
I suspect that adding these controls to a collection and then iterating through them is the better solution, but I do not know how.
Suggestions and/or sample code much appreciated.
Regards,
B.E.

I have:
chkMelbourne
chkPerth
chkAdelaide
chkBrisbane
chkHobart
chkDarwin
chkSydney
I need to alter their Enabled property based on the state of other checkboxes in my application, but would rather reference them in a group as opposed to individually. Some are enabled, some arent. The longhand way (if constructs and select case clauses)are making the code far too verbose. :-(
I suspect that adding these controls to a collection and then iterating through them is the better solution, but I do not know how.
Suggestions and/or sample code much appreciated.
Regards,
B.E.