Disabled
The Disabled Control Object property allows the script to set the Control Object to be 'grayed out', that is visible, but unavailable for selection or entry.
Syntax |
ControlObject.Disabled = Value Where ControlObject is the name of the Control Object that you are hiding/showing. |
Description |
Sets the control to be 'grayed out' i.e. visible, but unavailable. |
Arguments |
Value {Boolean} If set to True (1), the Control Object is visible but unavailable for selection; if set to False (0) the Control Object is visible and available for selection. |
Returns |
Boolean. |
Example:
A script is created that allows the following Form to be displayed when an 'Override' button is selected on a Mimic:
It is decided that another field should be added to the Form and that the field should indicate the type of action that is to be executed. As the Form is only displayed when the user attempts to override a point for Valve 1, the new field needs to indicate that an Override control will be executed. The new field is for information only, and so is to be 'grayed out'.
A new variable named frmConfirm is added to the script, and a StaticText item containing the string "Action to be performed on Valve 1" is also added. The settings for the new field (Edit box) are defined by the lines:
- Set frmConfirmAction = Form.AddEditBox(60,5)
- frmConfirmAction.MaxLength = 10
- frmConfirmAction.Value = "Override"
- frmConfirmAction.Disabled = True
This adds a new edit box at coordinates 60, 5. It has a maximum character length of 10, and its value is set to be Override. As the field is to be 'grayed out', the Disabled property is referenced and set to True.
When the Form is re-displayed, the new grayed out field is added: