I got a blank project, i added 3 checkboxes, and 1 inside a group box.
And i got this code:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
For Each phCheck As Control In Me.Controls
If TypeOf phCheck Is CheckBox AndAlso DirectCast(phCheck, CheckBox).Checked Then
If phCheck.Tag Is "Test" Then
DirectCast(phCheck, CheckBox).Checked = CBool(CheckState.Unchecked)
End If
End If
Next
End Sub
I added the tag "Test" to all the checkboxes, and when i click the button all checkboxes goes to unchecked except the one inside the group box, how can i loop through the controls inside of a container ?