{"name":"ctrlSetText","operator":null,"title":"ctrlSetText","type":"command","url":"https://community.bistudio.com/wiki/ctrlSetText","revid":378494,"updated":"2026-04-26T15:15:10Z","groups":["GUI Control"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.75"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofp","name":"Operation Flashpoint","version":"1.75"},"arma3_since":"0.50","branch":null,"locality":{"argument":"local","effect":"local","server_exec":false},"exec":null,"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.\n\nUse endl to insert line breaks.\n\nSince Arma 3 v2.06 supported control types are:\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]","since":null,"effect":null,"exec":null,"params":[{"name":"idc","type":"Number","optional":false,"default":null,"description":"control IDC","types":["Number"],"since":null,"text":"idc: Number - control IDC"},{"name":"text","type":"String","optional":false,"default":null,"description":"text or image path or texture, depending on the control type","types":["String"],"since":null,"text":"text: String - text or image path or texture, depending on the control type"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"unary","operator":null,"left":null,"right":{"text":"[idc, text]","types":["Array"]}},{"syntax":"control ctrlSetText text","since":null,"effect":null,"exec":null,"params":[{"name":"control","type":"Control","optional":false,"default":null,"description":"control","types":["Control"],"since":null,"text":"control: Control - control"},{"name":"text","type":"String","optional":false,"default":null,"description":"text or image path or texture, depending on the control type","types":["String"],"since":null,"text":"text: String - text or image path or texture, depending on the control type"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"control","types":["Control"]},"right":{"text":"text","types":["String"]}}],"examples":[{"text":"```sqf\nctrlSetText [100, \"Hello world\"]; // for Dialogs\n```","code":["ctrlSetText [100, \"Hello world\"]; // for Dialogs"]},{"text":"```sqf\n_control ctrlSetText \"Hello world.\"; // for Displays\n```","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};"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["ctrlText","ctrlTextSelection","ctrlSetTextSelection"],"notes":[],"categories":[]}