You need to go through the Controls collection of the control into which the check box is added. Each Control object has a collection of Controls. I would prefer the βeveryβ loop in this scenario, so I will immediately get Control without having to use it using the Controls index. If your CheckBoxes are added to the panel directly, the easiest way to do this would be ...
For Each ctrl As var In panel.Controls
If TypeOf ctrl Is CheckBox AndAlso DirectCast(ctrl, CheckBox).IsChecked Then
'Do Something
End If
Next
source
share