{"name":"ctrlText","title":"ctrlText","type":"command","url":"https://community.bistudio.com/wiki/ctrlText","revid":378493,"updated":"2026-04-26T15:11:35Z","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","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\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","params":[{"name":"idc","type":"Number","description":"control ID","type_expr":"Number"}],"returns":{"type":"String","type_expr":"String","description":"the text or image path or texture is returned, dependent on the control type"},"form":"unary","right":{"text":"idc"}},{"syntax":"ctrlText controlName","params":[{"name":"controlName","type":"Control","description":"control","type_expr":"Control"}],"returns":{"type":"String","type_expr":"String","description":"the text or image path or texture is returned, dependent on the control type"},"form":"unary","right":{"text":"controlName"}}],"examples":[{"code":["_text = ctrlText 100;"]},{"code":["_text = ctrlText _control;"]}],"see_also":["ctrlTextSecondary","ctrlSetText","Arma: GUI Configuration"]}