---
title: "enableControl"
canonical: "https://help.vicon.com/space/Shogun17/13536441/enableControl"
format: markdown
---
# 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 

> Macro (scroll-pagebreak)

## Examples

```plaintext
// 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](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13536367)
- [getControlPos](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13536365)
- [getControlText](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13536363)
- [getControlVisibility](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13536361)
- [getFocus](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13536347)
- [setControlAnchor](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13536908)
- [setControlPos](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13537274)
- [setControlText](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13537272)
- [setControlTip](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13537270)
- [setFocus](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13537138)
- [showControl](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13537435)