I was wondering if there is a way to loop thru all the controls on a form that will include all controls within container controls within the form. In other words, I handle such code like this:
Are the inner For Loops required in order to account for every control on a form or is there a better way to do this?
Thanks,
Code:
For Each ctl1 As Control In frm.Controls
If TypeOf(ctl1) Is GroupBox Then
For Each ctl2 In ctl1.Controls
...change property values
Next
ElseIf TypeOf(ctl1) Is TabControl Then
For Each ctl2 In ctl1.Controls
...change property values
Next
End If
Next
Thanks,