ctrlSetText

From Bohemia Interactive Community
Hover & click on the images for description

Description

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 to insert line breaks. Since Arma 3 logo black.png 2.06 supported control types are: Since Arma 3 logo black.png 2.22 CT_PROGRESS is also supported.
Groups:
GUI Control

Syntax

Syntax:
ctrlSetText [idc, text]
Parameters:
idc: Number - control IDC
text: String - text or image path or texture, depending on the control type
Return Value:
Nothing

Alternative Syntax

Syntax:
control ctrlSetText text
Parameters:
control: Control - control
text: String - text or image path or texture, depending on the control type
Return Value:
Nothing

Examples

Example 1:
ctrlSetText [100, "Hello world"]; // for Dialogs
Example 2:
_control ctrlSetText "Hello world."; // for Displays
Example 3:
Since Arma 3 2.22:
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; };

Additional Information

See also:
ctrlText ctrlTextSelection ctrlSetTextSelection

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note