It ought to loop however many times there are controls in the groupbox. I see no code for counting the number of loops, so how do you know. You step through it?
Sorry for the horrible naming conv.
this works in Net for me
the groupbox has its own controls collection which all objects are added to when they are placed in the groupbox
Visual Basic:
Dim ctr As Control
For Each ctr In Me.GroupBox1.Controls
If TypeOf ctr Is Label Then
ctr.Text = "Cool"
End If
Next
therefore if you can reference the groupBox object you can refer to its collection property
[edit] or loop through collection using the .item[/edit]
Visual Basic:
Dim ctr1 As Control
Dim i As Integer
Dim l As Integer
i = GroupBox1.Controls.Count
If i > 0 Then
For l = 0 To (i - 1)
ctr1 = GroupBox1.Controls.Item(l)
Next
End If
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.