---
name: "ctrlEnable"
type: command
status: ok
groups: ["GUI Control"]
arma3_since: "0.50"
locality: {"argument": "local", "effect": "local", "server_exec": false}
source: https://community.bistudio.com/wiki/ctrlEnable
revid: 364166
updated: 2024-05-05T10:46:43Z
---

# ctrlEnable

*Command · GUI Control · Arma 3 v0.50 · introduced in Operation Flashpoint v1.75*

Locality: arguments **local** · effect **local**

## Description

Enables or disables a control of the currently active user dialog.
Disabled controls cannot be clicked onto.
Read Arma: GUI Configuration for more information about user dialogs and controls.

## Syntax

### Syntax 1

```sqf
ctrlEnable [idc, enable]
```

**Parameters:**

- `idc`: [Number](../topics/Number.md) - control IDC
- `enable`: [Boolean](../topics/Boolean.md) - [true](../commands/true.md) to enable the control, [false](../commands/false.md) to disable it

**Returns:** [Nothing](../topics/Nothing.md)

### Syntax 2

```sqf
controlName ctrlEnable enable
```

**Parameters:**

- `controlName`: [Control](../topics/Control.md)
- `enable`: [Boolean](../topics/Boolean.md)

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
ctrlEnable [100, false];
```

### Example 2

```sqf
_ctrl ctrlEnable false;
```

## See also

[ctrlEnabled](../commands/ctrlEnabled.md)

## Community notes

**Yuval** — 2017-07-20

Please do note that enabled controls can gain focus upon click. Therefore do not enable background controls or else they will cover any controls on top of them.

As a general rule of thumb, enabled controls should only be already on the top of the GUI.

---

**R3vo** — 2020-09-07

One can disable a control when it is loaded by using [ctrlEnable](../commands/ctrlEnable.md) in the [onLoad](../topics/User_Interface_Event_Handlers.md#onload) event handler.

```cpp
class MyDialog
{
    class MyControl
    {
        onLoad = "(_this # 0) ctrlEnable false;";
    };
};
```

<sub>Source: [BI Community Wiki — ctrlEnable](https://community.bistudio.com/wiki/ctrlEnable) (revision 364166).</sub>
