---
name: "ctrlSetText"
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/ctrlSetText
revid: 378494
updated: 2026-04-26T15:15:10Z
---

# ctrlSetText

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

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

## Description

Sets the text of a control of the currently active user dialog or display.
This command can be used for static texts, buttons, edit lines and active texts as well as for images, where you can use it to set the image path.

Read Arma: GUI Configuration for more information about user dialogs and controls.

Use [endl](../commands/endl.md) to insert line breaks.

Since Arma 3 v2.06 supported control types are:
- CT_STATIC
- CT_EDIT
- CT_XKEYDESC
- CT_XBUTTON
- CT_SHORTCUTBUTTON
- CT_STRUCTURED_TEXT
- CT_BUTTON
- CT_ACTIVETEXT

Since Arma 3 v2.22 CT_PROGRESS is also supported.

## Syntax

### Syntax 1

```sqf
ctrlSetText [idc, text]
```

**Parameters:**

- `idc`: [Number](../topics/Number.md) - control IDC
- `text`: [String](../topics/String.md) - text or image path or texture, depending on the control type

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

### Syntax 2

```sqf
control ctrlSetText text
```

**Parameters:**

- `control`: [Control](../topics/Control.md) - control
- `text`: [String](../topics/String.md) - text or image path or texture, depending on the control type

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

## Examples

### Example 1

```sqf
ctrlSetText [100, "Hello world"]; // for Dialogs
```

### Example 2

```sqf
_control ctrlSetText "Hello world."; // for Displays
```

### Example 3

Since Arma 3 2.22:

```sqf
with uiNamespace do 
{ 
 bar = findDisplay 46 ctrlCreate ["RscProgress", -1]; 
 bar ctrlSetText "\A3\Data_F\Flags\Flag_red_CO.paa";
 bar ctrlSetPosition [0,0,1,0.25]; 
 bar ctrlCommit 0; 
 bar progressSetPosition 0.7;
};
```

## See also

[ctrlText](../commands/ctrlText.md) · [ctrlTextSelection](../commands/ctrlTextSelection.md) · [ctrlSetTextSelection](../commands/ctrlSetTextSelection.md)

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