---
name: "CT LISTBOX"
type: topic
source: https://community.bistudio.com/wiki/CT_LISTBOX
revid: 352975
updated: 2024-03-08T10:39:44Z
---

# CT LISTBOX

### Introduction

The listbox displays a list of items. With ST_MULTI it is possible to select multiple entries. For listBoxes, the usage of 'ST_' style constants (ST_MULTI & ST_TITLE_BAR) behave differently than expected for other controls, so use the corresponding 'LB_' (LB_TEXTURES & LB_MULTI) list box style variants instead.

```cpp
style = LB_TEXTURES; // solid scrollbar
style = LB_MULTI; // multiple item selection
```

#### Related commands & functions

- Commands: General
- Commands: UI Eventhandlers
- Commands: Listbox

#### Related User Interface Eventhandlers

- [Events: General](../topics/User_Interface_Event_Handlers.md#generic-events)
- [Events: Listbox](../topics/User_Interface_Event_Handlers.md#listbox-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_LISTBOX 5
```

#### A

##### active

**Type:** String

**Description:** n/a

```cpp
active = "a3\ui_f\data\gui\rsc\rscdisplaysinglemission\done_ca.paa";
```

##### addons

**Type:** String

**Description:** n/a

```cpp
addons = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_addons_ca.paa";
```

##### allowedFilePatching

**Type:** String

**Description:** n/a

```cpp
allowedFilePatching = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_version_ca.paa";
```

##### arrowEmpty

**Type:** String

**Description:** n/a

```cpp
arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)";
```

##### arrowFull

**Type:** String

**Description:** n/a

```cpp
arrowFull = "#(argb,8,8,3)color(1,1,1,1)";
```

##### autoScrollDelay

**Type:** Number

**Description:** n/a

```cpp
autoScrollDelay = 5;
```

##### autoScrollRewind

**Type:** Number

**Description:** n/a

```cpp
autoScrollRewind = 0;
```

##### autoScrollSpeed

**Type:** Number

**Description:** n/a

```cpp
autoScrollSpeed = -1;
```

#### C

##### canDrag

**Type:** Number

**Description:** Allow dragging and dropping listbox items similar to how the inventory works.

```cpp
canDrag = 0;
```

##### collisionColor

**Type:** Array

**Description:** Color of the collision key binding; default {1,0,0,1} - Only relevant to config keys dialog (type = 5; idc = 102)

```cpp
collisionColor[] = {"(profilenamespace getvariable ['IGUI_ERROR_RGB_R',0.8])","(profilenamespace getvariable ['IGUI_ERROR_RGB_G',0.0])","(profilenamespace getvariable ['IGUI_ERROR_RGB_B',0.0])",1};
```

##### collisionColorFirstKey

**Type:** Array

**Description:** n/a

```cpp
collisionColorFirstKey[] = {"(profilenamespace getvariable ['IGUI_WARNING_RGB_R',0.8])","(profilenamespace getvariable ['IGUI_WARNING_RGB_G',0.5])","(profilenamespace getvariable ['IGUI_WARNING_RGB_B',0.0])",1};
```

##### color

**Type:** Array

**Description:** n/a

```cpp
color[] = {0.95,0.95,0.95,1};
```

##### colorAI

**Type:** Array

**Description:** n/a

```cpp
colorAI[] = {1,0,0,1};
```

##### colorNobody

**Type:** Array

**Description:** n/a

```cpp
colorNobody[] = {1,1,1,0.25};
```

##### colorPicture

**Type:** Array

**Description:** n/a

```cpp
colorPicture[] = {1,1,1,1};
```

##### colorPictureDisabled

**Type:** Array

**Description:** n/a

```cpp
colorPictureDisabled[] = {1,1,1,0.25};
```

##### colorPictureRight

**Type:** Array

**Description:** n/a

```cpp
colorPictureRight[] = {1,1,1,1};
```

##### colorPictureRightDisabled

**Type:** Array

**Description:** n/a

```cpp
colorPictureRightDisabled[] = {1,1,1,0.25};
```

##### colorPictureRightSelected

**Type:** Array

**Description:** n/a

```cpp
colorPictureRightSelected[] = {1,1,1,1};
```

##### colorPictureSelected

**Type:** Array

**Description:** n/a

```cpp
colorPictureSelected[] = {1,1,1,1};
```

##### colorPingBad

**Type:** Array

**Description:** n/a

```cpp
colorPingBad[] = {1,0,0,1};
```

##### colorPingGood

**Type:** Array

**Description:** n/a

```cpp
colorPingGood[] = {0,1,0,1};
```

##### colorPingPoor

**Type:** Array

**Description:** n/a

```cpp
colorPingPoor[] = {1,0.6,0,1};
```

##### colorPingUnknown

**Type:** Array

**Description:** n/a

```cpp
colorPingUnknown[] = {0.4,0.4,0.4,1};
```

##### colorPlayer

**Type:** Array

**Description:** n/a

```cpp
colorPlayer[] = {1,1,0,1};
```

##### colorScrollbar

**Type:** Array

**Description:** n/a

```cpp
colorScrollbar[] = {1,0,0,0};
```

##### colorSelect

**Type:** Array

**Description:** Text color of a selected item.

```cpp
colorSelect[] = {1,1,1,1};
```

##### colorSelect2

**Type:** Array

**Description:** Text color to pulsate to from `colorSelect`.

```cpp
colorSelect2[] = {0,0,0,1};
```

##### colorSelect2Right

**Type:** Array

**Description:** n/a

```cpp
colorSelect2Right[] = {0,0,0,1};
```

##### colorSelectBackground

**Type:** Array

**Description:** Background color of a selected entry.

```cpp
colorSelectBackground[] = {0.95,0.95,0.95,1};
```

##### colorSelectBackground2

**Type:** Array

**Description:** Background color to pulsate to from `colorSelectBackground` of a selected entry.

```cpp
colorSelectBackground2[] = {1,1,1,0.5};
```

##### colorSelectRight

**Type:** Array

**Description:** n/a

```cpp
colorSelectRight[] = {0,0,0,1};
```

##### colorShadow

**Type:** Array

**Description:** n/a

```cpp
colorShadow[] = {0,0,0,0.5};
```

##### colorTextRight

**Type:** Array

**Description:** n/a

```cpp
colorTextRight[] = {1,1,1,1};
```

##### columns

**Type:** Number, Class

**Description:** n/a

Number example:

```cpp
columns = 1;
```

Class example:

```cpp
class Columns
{
    class ColumnFavorite
    {
        x = "1.2 * (((safezoneW / safezoneH) min 1.2) / 40) + (SafezoneX)";
        w = "(2 * (((safezoneW / safezoneH) min 1.2) / 40))";
    };
    class ColumnServer
    {
        x = "2.7 * (((safezoneW / safezoneH) min 1.2) / 40) + (SafezoneX)";
        w = "(11 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.45*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
    };
    class ColumnType
    {
        x = "safezoneX + (15 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.45*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
        w = "3 * (((safezoneW / safezoneH) min 1.2) / 40)";
    };
    class ColumnMission
    {
        x = "safezoneX + (18.3 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.45*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
        w = "(10.5 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.45*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
    };
    class ColumnState
    {
        x = "safezoneX + (29.1 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.9*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
        w = "3 * (((safezoneW / safezoneH) min 1.2) / 40)";
    };
    class ColumnPlayers
    {
        x = "safezoneX + (32.4 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.9*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
        w = "3 * (((safezoneW / safezoneH) min 1.2) / 40)";
    };
    class ColumnPing
    {
        x = "safezoneX + (35.7 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.9*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
        w = "3 * (((safezoneW / safezoneH) min 1.2) / 40)";
    };
};
```

#### D

##### disabled

**Type:** String

**Description:** n/a

```cpp
disabled = "a3\ui_f\data\gui\rsc\rscdisplaysinglemission\none_ca.paa";
```

##### disabledAI

**Type:** String

**Description:** n/a

```cpp
disabledAI = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayersetup\disabledai_ca.paa";
```

##### disabledCtrlColor

**Type:** Array

**Description:** n/a

```cpp
disabledCtrlColor[] = {1,1,1,0.5};
```

##### disabledKeyColor

**Type:** Array

**Description:** Color of the disabled key binding; default {0.3,0.3,0.3,1} - Only relevant to config keys dialog (type = 5; idc = 102)

```cpp
disabledKeyColor[] = {0.4,0.4,0.4,1};
```

##### DLCTemplate

**Type:** Class

**Description:** n/a

```cpp
class DLCTemplate
{
    class controls
    {
        class DlcBg
        {
            idc = 101;
            text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayInventory\InventoryStripe_ca.paa";
            color[] = {1,1,1,1};
            x = 0;
            y = 0;
            w = "1.8 * (((safezoneW / safezoneH) min 1.2) / 40)";
            h = "1.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
        };
        class DlcIcon
        {
            idc = 100;
            text = "";
            color[] = {1,1,1,1};
            x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)";
            y = "0 * (((safezoneW / safezoneH) min 1.2) / 40)";
            w = "1 * (((safezoneW / safezoneH) min 1.2) / 40)";
            h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
        };
    };
};
```

#### E

##### enabled

**Type:** String

**Description:** n/a

```cpp
enabled = "a3\ui_f\data\gui\rsc\rscdisplaysinglemission\done_ca.paa";
```

##### enabledAI

**Type:** String

**Description:** n/a

```cpp
enabledAI = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayersetup\enabledai_ca.paa";
```

#### I

##### idcx

**Type:** Number

**Description:** Used in the Arsenal display for unknown reason.

```cpp
idcx = 974;
```

##### itemBackground

**Type:** Array

**Description:** n/a

```cpp
itemBackground[] = {1,1,1,0.1};
```

##### Items

**Type:** Class

**Description:** Default entries for the listbox columns.

```cpp
// Yes, this is a vanilla config :D
class Items
{
    class Item0
    {
        text = "LOL";
        textRight = "ROFL";
        tooltip = "OMG";
        picture = "\a3\Ui_f\data\Map\Markers\Military\warning_CA.paa";
        pictureRight = "\a3\Ui_f\data\Map\Markers\Military\unknown_CA.paa";
        color[] = {1,0,1,1};
        colorRight[] = {1,1,0,1};
        colorPicture[] = {0,1,1,1};
        colorPictureSelected[] = {1,0,0,1};
        colorPictureDisabled[] = {0,0,0,1};
        colorPictureRight[] = {0,1,0,1};
        colorPictureRightSelected[] = {0,0,1,1};
        colorPictureRightDisabled[] = {0,0,0,1};
        data = "WTF";
        value = 42;
        default = 0;
    };
    class AnotherItem
    {
        text = "O RLY";
        default = 1;
    };
};
```

##### itemSpacing

**Type:** Number

**Description:** n/a

```cpp
itemSpacing = 0;
```

#### L

##### ListScrollBar

**Type:** Class

**Description:** Prior to Arma 3 use ScrollBar. Scrollbars might not show if h and w properties of the ListBox are not 0. see also DialogControls-Sliders

```cpp
class ListScrollBar
{
    color[] = {1,1,1,1};
    autoScrollEnabled = 1;
    colorActive[] = {1,1,1,1};
    colorDisabled[] = {1,1,1,0.3};
    thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
    arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
    arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
    border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
    shadow = 0;
    scrollSpeed = 0.06;
    width = 0;
    height = 0;
    autoScrollSpeed = -1;
    autoScrollDelay = 5;
    autoScrollRewind = 0;
};
```

##### locked

**Type:** String

**Description:** n/a

```cpp
locked = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_locked_ca.paa";
```

#### M

##### mainCollumW

**Type:** Number

**Description:** Width of the left column 0..1; default 0.4 - Only relevant to config keys dialog (type = 5; idc = 102)

```cpp
mainCollumW = 0.4;
```

##### maxHistoryDelay

**Type:** Number

**Description:** n/a

```cpp
maxHistoryDelay = 1;
```

##### mods

**Type:** String

**Description:** n/a

```cpp
mods = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_mods_ca.paa";
```

#### N

##### none

**Type:** String

**Description:** n/a

```cpp
none = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_none_ca.paa";
```

#### P

##### password

**Type:** String

**Description:** n/a

```cpp
password = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_password_ca.paa";
```

##### period

**Type:** Number

**Description:** Controls how fast the color changes from colorXXX to colorXXX2.

```cpp
period = 1.2;
```

#### R

##### rowHeight

**Type:** Number, String

**Description:** The height of a single row.

Number example:

```cpp
rowHeight = 0;
```

String example:

```cpp
rowHeight = "1.75 * (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
```

##### rows

**Type:** Number

**Description:** n/a

```cpp
rows = 8;
```

#### S

##### secndCollumW

**Type:** Number

**Description:** Width of the right column 0..1; default 0.6 - Only relevant to config keys dialog (type = 5; idc = 102)

```cpp
secndCollumW = 0.6;
```

##### serverDislike

**Type:** String

**Description:** n/a

```cpp
serverDislike = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\mp_serverdislike_ca.paa";
```

##### serverEmpty

**Type:** String

**Description:** n/a

```cpp
serverEmpty = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\mp_serverempty_ca.paa";
```

##### serverLike

**Type:** String

**Description:** n/a

```cpp
serverLike = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\mp_serverlike_ca.paa";
```

##### sizeEx2

**Type:** String

**Description:** n/a

```cpp
sizeEx2 = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
```

##### soundSelect

**Type:** Array

**Description:** Sound played when an entry is selected.

```cpp
soundSelect[] = {"\A3\ui_f\data\sound\RscListbox\soundSelect",0.09,1};
```

##### star

**Type:** String

**Description:** n/a

```cpp
star = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_star_ca.paa";
```

#### V

##### version

**Type:** String

**Description:** n/a

```cpp
version = "a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\sessions_version_ca.paa";
```

#### W

##### wholeHeight

**Type:** Number

**Description:** n/a

```cpp
wholeHeight = 0.21;
```

### Default Classes

> [!NOTE]
> **Arma 3:** **AddOns:** Classes need to be initialised first with `class SomeClass;`
>
> ---
>
> **Missions:** Since Arma 3 v2.02 one can use `import SomeClass;` to initialise a class (see the [import](../topics/import_~28Config~29.md) keyword).
>
> In older versions, use `"Default" call BIS_fnc_exportGUIBaseClasses;` and paste the result into the [description.ext](../topics/Description.ext.md).

#### RscListBox

```cpp
class RscListBox
{
    deletable = 0;
    fade = 0;
    access = 0;
    type = CT_LISTBOX;
    rowHeight = 0;
    colorText[] = {1,1,1,1};
    colorDisabled[] = {1,1,1,0.25};
    colorScrollbar[] = {1,0,0,0};
    colorSelect[] = {0,0,0,1};
    colorSelect2[] = {0,0,0,1};
    colorSelectBackground[] = {0.95,0.95,0.95,1};
    colorSelectBackground2[] = {1,1,1,0.5};
    colorBackground[] = {0,0,0,0.3};
    soundSelect[] =
    {
        "\A3\ui_f\data\sound\RscListbox\soundSelect",
        0.09,
        1
    };
    autoScrollSpeed = -1;
    autoScrollDelay = 5;
    autoScrollRewind = 0;
    arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)";
    arrowFull = "#(argb,8,8,3)color(1,1,1,1)";
    colorPicture[] = {1,1,1,1};
    colorPictureSelected[] = {1,1,1,1};
    colorPictureDisabled[] = {1,1,1,0.25};
    colorPictureRight[] = {1,1,1,1};
    colorPictureRightSelected[] = {1,1,1,1};
    colorPictureRightDisabled[] = {1,1,1,0.25};
    colorTextRight[] = {1,1,1,1};
    colorSelectRight[] = {0,0,0,1};
    colorSelect2Right[] = {0,0,0,1};
    tooltipColorText[] = {1,1,1,1};
    tooltipColorBox[] = {1,1,1,1};
    tooltipColorShade[] = {0,0,0,0.65};
    class ListScrollBar : ScrollBar
    {
        color[] = {1,1,1,1};
        autoScrollEnabled = 1;
    };
    x = 0;
    y = 0;
    w = 0.3;
    h = 0.3;
    style = LB_TEXTURES;
    font = "RobotoCondensed";
    sizeEx = GUI_TEXT_SIZE_MEDIUM;
    shadow = 0;
    colorShadow[] = {0,0,0,0.5};
    period = 1.2;
    maxHistoryDelay = 1;
};
```

#### Scripting Example

| Code | Picture |
|---|---|
| ```sqf<br>{<br>    private _ctrl = _x;<br>    {<br>        _ctrl lbAdd getText (_x >> "displayName");<br>        _ctrl lbSetPicture [_foreachindex,getText (_x >> "texture")];<br>        _ctrl lbSetTooltip [_foreachindex,getText (_x >> "displayName")];<br>    } forEach ("true" configClasses (configFile >> "CfgRanks"));<br>    _ctrl lbSetCurSel 0;<br>``` |  |
| ```sqf<br>    private _current = lbCurSel _ctrl;<br>    _ctrl lbSetData [_current,"hi"];<br>    private _data = _ctrl lbData _current;<br>    private _pic = _ctrl lbPicture _current;<br>    _ctrl lbSetValue [_current, 1];<br>    private _value = _ctrl lbValue _current;<br>    private _size = lbSize _ctrl;<br>    private _color = _ctrl lbColor _current;<br>    _ctrl lbSetColor [_current, [(_color select 0) / 2, (_color select 1) / 4, 0, 1]];<br>``` |  |
| ```sqf<br>    lbSort [_ctrl, "DESC"];<br>    lbSortByValue _ctrl;<br>``` |  |
| ```sqf<br>    if (_ctrl lbIsSelected _current) then<br>    {<br>        _ctrl lbDelete _current;<br>        lbClear _ctrl;<br>    };<br>} forEach [_CT_COMBO, _CT_LISTBOX, _CT_XLISTBOX, _CT_XCOMBO];<br>``` |  |

[CT_LISTBOX](../topics/CT_LISTBOX.md) command family can be used with [CT_COMBO](../topics/CT_COMBO.md), [CT_LISTBOX](../topics/CT_LISTBOX.md), [CT_XLISTBOX](../topics/CT_XLISTBOX.md) and [CT_XCOMBO](../topics/CT_XCOMBO.md).

<sub>Source: [BI Community Wiki — CT LISTBOX](https://community.bistudio.com/wiki/CT_LISTBOX) (revision 352975).</sub>
