I want to pass a Frame control to a sub, so that I can enable/disable all controls
that are contained on the frame, with a simple loop

I've already set the container property of each control to the Frame.
(this code not shown for simplicity)

Now I just need to loop through all the controls and enable/disable them.

I don't know how to pass the Frame as a control or object, in the actual Call.

private const CTRLS_ENABLED AS BOOLEAN = True

'caller
SetControls(frmColors, CTRLS_ENABLED)
' this call doesn't work, because it passes the Caption propertuy by default

'Private Sub SetControls(Parent As Control, CtrlState As Boolean)
'Private Sub SetControls(Parent As Object, CtrlState As Boolean)
Private Sub SetControls(Parent As Frame, CtrlState As Boolean)

Dim Ctrl As Control

On Error Resume Next
For Each Ctrl In Parent
Ctrl.Enabled = CtrlState
Next Ctrl

End Sub

Can someone help me out here ?

thanks