---
name: "CT CONTROL REF"
type: topic
source: https://community.bistudio.com/wiki/CT_CONTROL_REF
revid: 379127
updated: 2026-10-09T13:06:35Z
---

# CT CONTROL REF

Arma 3 v2.24

### Introduction

Renders a different references control, in the position of this control.\
[ctrlWebBrowserAction](../commands/ctrlWebBrowserAction.md) can be used to change the source control.

The 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.

#### Related commands & functions

- Commands: General
- Commands: UI Eventhandlers

#### Related User Interface Eventhandlers

- [Events: General](../topics/User_Interface_Event_Handlers.md#generic-events)

### Alphabetical Order

> [!NOTE]
> TokenNames common to most controls, such as x, y, w, h, text, idc... can be found [**here**](../topics/Arma~3A_GUI_Configuration.md#common-properties).

> [!WARNING]
> 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.

```cpp
#define CT_CONTROL_REF 108
```

### Scripting

> [!NOTE]
> See [ctrlWebBrowserAction](../commands/ctrlWebBrowserAction.md).

##### Example

Here is an example.
First there is a Display that contains a WebBrowser control.
Then a second Display, renders the WebBrowser control of the first display.

description.ext:

```cpp
class RscDisplayBrowser
{
    idd=157;
    class Controls
    {
        class WebTest: RscText
        {
            type=106;
            idc=1337;
            x="0";
            y="0";
            w="1";
            h="1";

            url = "arma://test.html"; // You need to create your own html file to test this with and place it in your mission folder
        };
    };
    // Init script to store it in variable so we can find it later, and EachFrame updating because this will be put on a ui2texture
    onLoad = "GMyData = _this, uiNamespace setVariable ['GMyData', _this]; addMissionEventHandler ['EachFrame', {_disp = _thisArgs#0; displayUpdate _disp;}, [_this#0]];";
};

class RscDisplayRef
{
    idd=158;
    class Controls
    {
        class ReferenceTest: RscText
        {
            type=108;
            idc=1337;
            x= safeZoneX;
            y= safeZoneY + 0.5;
            w= 0.5;
            h= 0.5;
        };
    };

    // Init script, finds the RscDisplayBrowser which was stored in GMyData. Then finds its WebBrowser control and applies it to here
    onLoad = "_disp = _this#0; _ctrl = _this#0 displayCtrl 1337; _ctrl ctrlWebBrowserAction ['SetBrowserReference', GMyData#0 displayCtrl 1337];";
};
```

To test it in a mission, place a "User Texture" object, and set its texture to

```sqf
#(rgb,1024,1024,3)ui("RscDisplayBrowser","abc")
```

Then create the reference display using

```sqf
createDialog "RscDisplayRef";
```

Now you have a interactive dialog, who's mouse/keyboard inputs are applied to the control that renders inside the texture.

<sub>Source: [BI Community Wiki — CT CONTROL REF](https://community.bistudio.com/wiki/CT_CONTROL_REF) (revision 379127).</sub>
