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.
User Window
enableControl userControlID enableBoolean |
Name | Type | Required | Comments |
---|---|---|---|
enableBoolean | boolean | yes | Flag to enable/disable the user control |
userControlId | int | yes | ID of user control to enable/disable. |
None
boolean
// 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; |