Q: enum controls

  • Thread starter Thread starter HABJAN ®iga
  • Start date Start date
H

HABJAN ®iga

Is there a way to enumerate all controls in a form (for each c in form) -
(even nested ones: in panels,...)?

best re,
habix
 
HABJAN ®iga said:
Is there a way to enumerate all controls in a form (for each c in
form) - (even nested ones: in panels,...)?


Private Sub EnumControls(ByVal Controls As Control.ControlCollection)
Dim c As Control
For Each c In Controls
'process c here..
'.. and recursively call the function:
EnumControls(c.Controls)
Next
End Sub


Call in the Form:
EnumControls Me.Controls
 
Back
Top