{"name":"CT CONTROL REF","title":"CT CONTROL REF","type":"topic","url":"https://community.bistudio.com/wiki/CT_CONTROL_REF","revid":379127,"updated":"2026-10-09T13:06:35Z","aliases":[],"markdown":"Arma 3 v2.24\n\n### Introduction\n\nRenders a different references control, in the position of this control.\nctrlWebBrowserAction can be used to change the source control.\n\nThe reference control holds a weak reference/link to the source control. If the source is closed, the reference will display nothing as if it were an empty control.\n\n#### Related commands & functions\n\n- Commands: General\n- Commands: UI Eventhandlers\n\n#### Related User Interface Eventhandlers\n\n- Events: General\n\n### Alphabetical Order\n\n> [!NOTE]\n> TokenNames common to most controls, such as x, y, w, h, text, idc... can be found **here**.\n\n> [!WARNING]\n> Not all of the listed attributes might have an effect nor might the list be complete. All attributes were gathered with [this](https://github.com/7erra/BIKI.VR/blob/master/fnc/generateCTPage.sqf) config crawler.\n\n```cpp\n#define CT_CONTROL_REF 108\n```\n\n### Scripting\n\n> [!NOTE]\n> See ctrlWebBrowserAction.\n\n##### Example\n\nHere is an example.\nFirst there is a Display that contains a WebBrowser control.\nThen a second Display, renders the WebBrowser control of the first display.\n\ndescription.ext:\n\n```cpp\nclass RscDisplayBrowser\n{\n    idd=157;\n    class Controls\n    {\n        class WebTest: RscText\n        {\n            type=106;\n            idc=1337;\n            x=\"0\";\n            y=\"0\";\n            w=\"1\";\n            h=\"1\";\n\n            url = \"arma://test.html\"; // You need to create your own html file to test this with and place it in your mission folder\n        };\n    };\n    // Init script to store it in variable so we can find it later, and EachFrame updating because this will be put on a ui2texture\n    onLoad = \"GMyData = _this, uiNamespace setVariable ['GMyData', _this]; addMissionEventHandler ['EachFrame', {_disp = _thisArgs#0; displayUpdate _disp;}, [_this#0]];\";\n};\n\nclass RscDisplayRef\n{\n    idd=158;\n    class Controls\n    {\n        class ReferenceTest: RscText\n        {\n            type=108;\n            idc=1337;\n            x= safeZoneX;\n            y= safeZoneY + 0.5;\n            w= 0.5;\n            h= 0.5;\n        };\n    };\n\n    // Init script, finds the RscDisplayBrowser which was stored in GMyData. Then finds its WebBrowser control and applies it to here\n    onLoad = \"_disp = _this#0; _ctrl = _this#0 displayCtrl 1337; _ctrl ctrlWebBrowserAction ['SetBrowserReference', GMyData#0 displayCtrl 1337];\";\n};\n```\n\nTo test it in a mission, place a \"User Texture\" object, and set its texture to\n\n```sqf\n#(rgb,1024,1024,3)ui(\"RscDisplayBrowser\",\"abc\")\n```\n\nThen create the reference display using\n\n```sqf\ncreateDialog \"RscDisplayRef\";\n```\n\nNow you have a interactive dialog, who's mouse/keyboard inputs are applied to the control that renders inside the texture.","sections":[{"heading":null,"level":1,"markdown":"Arma 3 v2.24"},{"heading":"Introduction","level":3,"markdown":"Renders a different references control, in the position of this control.\nctrlWebBrowserAction can be used to change the source control.\n\nThe reference control holds a weak reference/link to the source control. If the source is closed, the reference will display nothing as if it were an empty control."},{"heading":"Related commands & functions","level":4,"markdown":"- Commands: General\n- Commands: UI Eventhandlers"},{"heading":"Related User Interface Eventhandlers","level":4,"markdown":"- Events: General"},{"heading":"Alphabetical Order","level":3,"markdown":"> [!NOTE]\n> TokenNames common to most controls, such as x, y, w, h, text, idc... can be found **here**.\n\n> [!WARNING]\n> Not all of the listed attributes might have an effect nor might the list be complete. All attributes were gathered with [this](https://github.com/7erra/BIKI.VR/blob/master/fnc/generateCTPage.sqf) config crawler.\n\n```cpp\n#define CT_CONTROL_REF 108\n```"},{"heading":"Scripting","level":3,"markdown":"> [!NOTE]\n> See ctrlWebBrowserAction."},{"heading":"Example","level":5,"markdown":"Here is an example.\nFirst there is a Display that contains a WebBrowser control.\nThen a second Display, renders the WebBrowser control of the first display.\n\ndescription.ext:\n\n```cpp\nclass RscDisplayBrowser\n{\n    idd=157;\n    class Controls\n    {\n        class WebTest: RscText\n        {\n            type=106;\n            idc=1337;\n            x=\"0\";\n            y=\"0\";\n            w=\"1\";\n            h=\"1\";\n\n            url = \"arma://test.html\"; // You need to create your own html file to test this with and place it in your mission folder\n        };\n    };\n    // Init script to store it in variable so we can find it later, and EachFrame updating because this will be put on a ui2texture\n    onLoad = \"GMyData = _this, uiNamespace setVariable ['GMyData', _this]; addMissionEventHandler ['EachFrame', {_disp = _thisArgs#0; displayUpdate _disp;}, [_this#0]];\";\n};\n\nclass RscDisplayRef\n{\n    idd=158;\n    class Controls\n    {\n        class ReferenceTest: RscText\n        {\n            type=108;\n            idc=1337;\n            x= safeZoneX;\n            y= safeZoneY + 0.5;\n            w= 0.5;\n            h= 0.5;\n        };\n    };\n\n    // Init script, finds the RscDisplayBrowser which was stored in GMyData. Then finds its WebBrowser control and applies it to here\n    onLoad = \"_disp = _this#0; _ctrl = _this#0 displayCtrl 1337; _ctrl ctrlWebBrowserAction ['SetBrowserReference', GMyData#0 displayCtrl 1337];\";\n};\n```\n\nTo test it in a mission, place a \"User Texture\" object, and set its texture to\n\n```sqf\n#(rgb,1024,1024,3)ui(\"RscDisplayBrowser\",\"abc\")\n```\n\nThen create the reference display using\n\n```sqf\ncreateDialog \"RscDisplayRef\";\n```\n\nNow you have a interactive dialog, who's mouse/keyboard inputs are applied to the control that renders inside the texture."}],"categories":["Control Types","Introduced with Arma 3 version 2.24"],"groups":["GUI"]}