-
Hi,
I have a frame and few controls on it (combos, labels etc.). I know that when I disable the frame, the controls that are on it get disabled too... but they they're not grayed out automatically.
Is there a way to gray them out when disabling the frame or do I have to use:
'control.Enabled = False'
to all of them?
Is there a better way to gray out a number of controls atatched to a frame?
Thanks
-
For every control in the Frame, set their Tag to 1. Then you can use a For...Each loop for every control, check if it's Tag is 1; if so, it will be disabled.
Code:
Frame1.Enabled = False
Dim ctl As Control
For Each ctl In Controls
If ctl.Tag = "1" Then ctl.Enabled = False
Next ctl