/
enableControl
enableControl
Description
Enables or disables the user control that is specified by userControlId
.
A control that is disabled is blocked from user input (mouse and keystrokes). It is also dimmed to indicate a disabled status.
Disable a control when you want to temporarily block users from interacting with a control.
All user controls are enabled by default.
Functional area
User Window
Command syntax
Syntax
enableControl userControlID enableBoolean |
Arguments
Name | Type | Required | Comments |
---|---|---|---|
enableBoolean | boolean | yes | Flag to enable/disable the user control |
userControlId | int | yes | ID of user control to enable/disable. |
Flags
None
Return value
boolean
Examples
// Show how to disable a control. int $windowId; int $controlId; boolean $wasEnabled; // First create a User Window to place the Control on $windowId = `createWindow "MyWindow"`; // Create a Push Button Control in the window. We will disable it // after we create it. $controlId = `createPushButton $windowId -text "Disabled"`; // Now disable the control $wasEnabled = `enableControl $controlId false`; print $wasEnabled;
Additional information
Related commands
- getControlEnabled
- getControlPos
- getControlText
- getControlVisibility
- getFocus
- setControlAnchor
- setControlPos
- setControlText
- setControlTip
- setFocus
- showControl
, multiple selections available,