{"name":"ctrlSetText","title":"ctrlSetText","type":"command","url":"https://community.bistudio.com/wiki/ctrlSetText","revid":378494,"updated":"2026-04-26T15:15:10Z","groups":["GUI Control"],"status":"ok","games":{"ofp":"1.75","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.75","arma3_since":"0.50","locality":{"argument":"local","effect":"local"},"description":"Sets the text of a control of the currently active user dialog or display.\nThis 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.\n\nRead Arma: GUI Configuration for more information about user dialogs and controls.\nUse endl to insert line breaks.\n\nSince Arma 3 v2.06 supported control types are:\n\n- CT_STATIC\n- CT_EDIT\n- CT_XKEYDESC\n- CT_XBUTTON\n- CT_SHORTCUTBUTTON\n- CT_STRUCTURED_TEXT\n- CT_BUTTON\n- CT_ACTIVETEXT\n\nSince Arma 3 v2.22 CT_PROGRESS is also supported.","syntaxes":[{"syntax":"ctrlSetText [idc, text]","params":[{"name":"idc","type":"Number","description":"control IDC","type_expr":"Number"},{"name":"text","type":"String","description":"text or image path or texture, depending on the control type","type_expr":"String"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"unary","right":{"text":"[idc, text]"}},{"syntax":"control ctrlSetText text","params":[{"name":"control","type":"Control","description":"control","type_expr":"Control"},{"name":"text","type":"String","description":"text or image path or texture, depending on the control type","type_expr":"String"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"control"},"right":{"text":"text"}}],"examples":[{"code":["ctrlSetText [100, \"Hello world\"]; // for Dialogs"]},{"code":["_control ctrlSetText \"Hello world.\"; // for Displays"]},{"text":"Since Arma 3 2.22:\n\n```sqf\nwith uiNamespace do\n{\n bar = findDisplay 46 ctrlCreate [\"RscProgress\", -1];\n bar ctrlSetText \"\\A3\\Data_F\\Flags\\Flag_red_CO.paa\";\n bar ctrlSetPosition [0,0,1,0.25];\n bar ctrlCommit 0;\n bar progressSetPosition 0.7;\n};\n```","code":["with uiNamespace do \n{ \n bar = findDisplay 46 ctrlCreate [\"RscProgress\", -1]; \n bar ctrlSetText \"\\A3\\Data_F\\Flags\\Flag_red_CO.paa\";\n bar ctrlSetPosition [0,0,1,0.25]; \n bar ctrlCommit 0; \n bar progressSetPosition 0.7;\n};"]}],"see_also":["ctrlText","ctrlTextSelection","ctrlSetTextSelection"]}