Arma 3 Scripting

ctrlEnable

  • Local argument
  • Local effect
  • Arma 3 v0.50
  • First in Operation Flashpoint v1.75

Command · Markdown · JSON · original wiki page

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

ctrlEnable [idc, enable]

Parameters:

Returns: Nothing

Syntax 2

controlName ctrlEnable enable

Parameters:

Returns: Nothing

Examples

Example 1

ctrlEnable [100, false];

Example 2

_ctrl ctrlEnable false;

See also

ctrlEnabled

Community notes

Yuval

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

One can disable a control when it is loaded by using ctrlEnable in the onLoad event handler.

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