{"name":"ctrlText","operator":null,"title":"ctrlText","type":"command","url":"https://community.bistudio.com/wiki/ctrlText","revid":378493,"updated":"2026-04-26T15:11:35Z","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":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns the text of a control of the currently active user dialog. This command can be used on static texts, buttons, edit lines and active texts as well as for images, where it returns the image path. Does not work on HTML control and returns empty string \"\". Since Arma 3 v2.05 supported control types are:\n- CT_STATIC\n\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.20 CT_PROGRESS is also supported.","syntaxes":[{"syntax":"ctrlText idc","since":null,"effect":null,"exec":null,"params":[{"name":"idc","type":"Number","optional":false,"default":null,"description":"control ID","types":["Number"],"since":null,"text":"idc: Number - control ID"}],"returns":{"type":"String","types":["String"],"description":"the text or image path or texture is returned, dependent on the control type","text":"String - the text or image path or texture is returned, dependent on the control type"},"form":"unary","operator":null,"left":null,"right":{"text":"idc","types":["Number"]}},{"syntax":"ctrlText controlName","since":null,"effect":null,"exec":null,"params":[{"name":"controlName","type":"Control","optional":false,"default":null,"description":"control","types":["Control"],"since":null,"text":"controlName: Control - control"}],"returns":{"type":"String","types":["String"],"description":"the text or image path or texture is returned, dependent on the control type","text":"String - the text or image path or texture is returned, dependent on the control type"},"form":"unary","operator":null,"left":null,"right":{"text":"controlName","types":["Control"]}}],"examples":[{"text":"```sqf\n_text = ctrlText 100;\n```","code":["_text = ctrlText 100;"]},{"text":"```sqf\n_text = ctrlText _control;\n```","code":["_text = ctrlText _control;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["ctrlTextSecondary","ctrlSetText","Arma: GUI Configuration"],"notes":[],"categories":[]}