isladogs
MVP / VIP
- Local time
- Today, 21:43
- Joined
- Jan 14, 2017
- Messages
- 18,563
The attached utility demonstrates a way of setting the state of a group of controls at the same time using the controls' Tag property.
The properties that can be controlled are: .Visible , .Enabled, .Locked
However, some control types do not allow all of the properties.
For example labels can not be disabled or locked
For full details of control types & properties, see the table tblControlTypes
All the controls in the 2 forms have tags A, B, C or D.
Use the buttons to control the state of those with tags A, B, C
To ensure the form remains usable, controls with tag D remain visible, enabled & unlocked at all times!
The forms aren't intended to be elegant, just to show what can be done
UPDATED 29/04/2017:
For portability, all the functionality is now included in the module modControlState.
There are 3 procedures: ShowControls, EnableControls & LockControls
2 forms have been included - identical apart from colour
This is just to confirm that the forms are controlled independently as you would expect
To use this approach, just copy the module modControlState to your own project
An alternative approach suggested by Static & using parameter arrays rather than tags is listed in Module1 but has not been used here
The properties that can be controlled are: .Visible , .Enabled, .Locked
However, some control types do not allow all of the properties.
For example labels can not be disabled or locked
For full details of control types & properties, see the table tblControlTypes
All the controls in the 2 forms have tags A, B, C or D.
Use the buttons to control the state of those with tags A, B, C
To ensure the form remains usable, controls with tag D remain visible, enabled & unlocked at all times!
The forms aren't intended to be elegant, just to show what can be done
UPDATED 29/04/2017:
For portability, all the functionality is now included in the module modControlState.
There are 3 procedures: ShowControls, EnableControls & LockControls
2 forms have been included - identical apart from colour
This is just to confirm that the forms are controlled independently as you would expect
To use this approach, just copy the module modControlState to your own project
An alternative approach suggested by Static & using parameter arrays rather than tags is listed in Module1 but has not been used here
Attachments
Last edited: