"AdeyS" <AdeyS (AT) discussions (DOT) microsoft.com> wrote
Quote:
If I step through the controls contained in a form using...
For i = 0 to controls.count - 1
msgbox(controls(i).Name)
next i
It will display the names of the controls on the form but will not display
the controls contained within the GroupBox.
What method do I need to use to examine the controls in the GroupBox?
The controls in the group box are a set of 8 comboboxes. |
The GroupBox is a container with its own Controls collection, so you'll need
to do something along these lines:
Dim i As Integer
For i = 0 To Controls.Count - 1
MsgBox(Controls(i).Name)
Next i
For i = 0 To GroupBox1.Controls.Count
MsgBox(GroupBox1.Controls(i).Name)
Next i
Note: Not thoroughly tested. You'll want to adapt the code to your
needs/taste.
Peter [MVP Visual Developer]
Jack of all trades, master of none.