---
name: "CT LISTNBOX"
type: topic
source: https://community.bistudio.com/wiki/CT_LISTNBOX
revid: 376157
updated: 2025-09-08T19:16:56Z
---

# CT LISTNBOX

### Introduction

Similar to [CT_LISTBOX](../topics/CT_LISTBOX.md). Additionally this control supports multiple columns which all have their own text, data and value. Another feature is the ability to define [idcLeft](../topics/CT_LISTNBOX.md#idcleft) and [idcRight](../topics/CT_LISTNBOX.md#idcright) to add buttons to the currently selected row.

> [!IMPORTANT]
> [CT_LISTNBOX](../topics/CT_LISTNBOX.md) controls frequently cause unexpected issues with other controls if `idcLeft` and `idcRight` are set to -1. Use other values for `idcLeft` and `idcRight` to avoid these issues.

#### Related commands & functions

- Commands: General
- Commands: UI Eventhandlers
- Commands: ListNBox
- Commands: Listbox
- [BIS_fnc_initListNBoxSorting](../functions/BIS_fnc_initListNBoxSorting.md)

#### 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_LISTNBOX 102
```

#### A

##### 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:** n/a

```cpp
canDrag = 1;
```

##### color

**Type:** Array

**Description:** n/a

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

##### 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};
```

##### colorPictureSelected

**Type:** Array

**Description:** n/a

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

##### colorPlayerItem

**Type:** Array

**Description:** n/a

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

##### colorScrollbar

**Type:** Array

**Description:** n/a

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

##### colorSelect

**Type:** Array

**Description:** n/a

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

##### colorSelect2

**Type:** Array

**Description:** n/a

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

##### colorSelect2Right

**Type:** Array

**Description:** n/a

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

##### colorSelectBackground

**Type:** Array

**Description:** n/a

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

##### colorSelectBackground2

**Type:** Array

**Description:** n/a

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

##### colorSelectRight

**Type:** Array

**Description:** n/a

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

##### colorShadow

**Type:** Array

**Description:** n/a

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

##### columns

**Type:** Array

**Description:** Define the left starting position of each column. The values are offsets ratios (not spacing ratios). Tip: Use {-0.01} in first column to fix unwanted offset, if desired.

```cpp
columns[] = {"7.2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)","15.8 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"};
```

#### D

##### disableOverflow

**Type:** Number

**Description:** Don't allow text to continue in next column.

```cpp
disableOverflow = 1;
```

##### drawSideArrows

**Type:** Number

**Description:** Each row can be linked to 2 arrow buttons which are shown on the left and right of the row.

> [!IMPORTANT]
> `drawSideArrows` attribute is irrelevant and does not control the appearance of the left and right arrows/buttons despite the intention, and it could be ignored all together. Instead, [idcLeft](../topics/CT_LISTNBOX.md#idcleft) and [idcRight](../topics/CT_LISTNBOX.md#idcright) attributes control these arrows/buttons.

```cpp
drawSideArrows = 1;
```

#### I

##### idcLeft

**Type:** Number

**Description:** The IDC of the control to be used for the left control that shows up in the selected row.

> [!IMPORTANT]
> Buttons will only be drawn if **both** idcLeft and idcRight are defined. Furthermore, the position of the first column needs to be adjusted so that the button does not overlap with the text. The button's height will be adjusted to the rowHeight property of the [CT_LISTNBOX](../topics/CT_LISTNBOX.md) and the button's x, y, w and h properties can be set to -1.

> [!IMPORTANT]
> -1 is a valid idc for this attribute!

```cpp
idcLeft = 24468;
```

##### idcRight

**Type:** Number

**Description:** The IDC of the control to be used for the right control that shows up in the selected row.

> [!IMPORTANT]
> -1 is a valid idc for this attribute!

```cpp
idcRight = 24469;
```

##### idcx

**Type:** Number

**Description:** Used in the Arsenal, can be ignored.

```cpp
idcx = 984;
```

##### Items

**Type:** Class

**Description:** List of default items. See [CT_COMBO#Items](../topics/CT_COMBO.md#items) for more details.

```cpp
class Items
{
    class Presence
    {
        text = "";
        value = 1;
        data = "value";
    };
    class Name
    {
        text = "Name";
        value = -1;
    };
    class Author
    {
        text = "Author";
        value = -1;
    };
};
```

#### L

##### ListScrollBar

**Type:** Class

**Description:** n/a

```cpp
class ListScrollBar
{
    color[] = {1,1,1,0.6};
    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;
    autoScrollEnabled = 0;
    autoScrollSpeed = -1;
    autoScrollDelay = 5;
    autoScrollRewind = 0;
};
```

#### M

##### maxHistoryDelay

**Type:** Number

**Description:** n/a

```cpp
maxHistoryDelay = 1;
```

##### MuteCheckBoxTemplate

**Type:** Class

**Description:** n/a

```cpp
class MuteCheckBoxTemplate
{
    x = 0;
    y = 0;
    w = "0.8 * (((safezoneW / safezoneH) min 1.2) / 40)";
    h = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
    textureChecked = "\A3\Ui_f\data\IGUI\RscIngameUI\RscDisplayChannel\MuteVON_ca.paa";
    textureUnchecked = "\A3\Ui_f\data\IGUI\RscIngameUI\RscDisplayChannel\MuteVON_crossed_ca.paa";
    textureFocusedChecked = "\A3\Ui_f\data\IGUI\RscIngameUI\RscDisplayChannel\MuteVON_ca.paa";
    textureFocusedUnchecked = "\A3\Ui_f\data\IGUI\RscIngameUI\RscDisplayChannel\MuteVON_crossed_ca.paa";
    textureHoverChecked = "\A3\Ui_f\data\IGUI\RscIngameUI\RscDisplayChannel\MuteVON_ca.paa";
    textureHoverUnchecked = "\A3\Ui_f\data\IGUI\RscIngameUI\RscDisplayChannel\MuteVON_crossed_ca.paa";
    texturePressedChecked = "\A3\Ui_f\data\IGUI\RscIngameUI\RscDisplayChannel\MuteVON_ca.paa";
    texturePressedUnchecked = "\A3\Ui_f\data\IGUI\RscIngameUI\RscDisplayChannel\MuteVON_crossed_ca.paa";
    textureDisabledChecked = "\A3\Ui_f\data\IGUI\RscIngameUI\RscDisplayChannel\MuteVON_ca.paa";
    textureDisabledUnchecked = "\A3\Ui_f\data\IGUI\RscIngameUI\RscDisplayChannel\MuteVON_crossed_ca.paa";
    idc = -1;
    type = 77;
    deletable = 0;
    style = 0;
    checked = 0;
    color[] = {1,1,1,0.7};
    colorFocused[] = {1,1,1,1};
    colorHover[] = {1,1,1,1};
    colorPressed[] = {1,1,1,1};
    colorDisabled[] = {1,1,1,0.2};
    colorBackground[] = {0,0,0,0};
    colorBackgroundFocused[] = {0,0,0,0};
    colorBackgroundHover[] = {0,0,0,0};
    colorBackgroundPressed[] = {0,0,0,0};
    colorBackgroundDisabled[] = {0,0,0,0};
    tooltipColorText[] = {1,1,1,1};
    tooltipColorBox[] = {1,1,1,1};
    tooltipColorShade[] = {0,0,0,0.65};
    soundEnter[] = {"",0.1,1};
    soundPush[] = {"",0.1,1};
    soundClick[] = {"",0.1,1};
    soundEscape[] = {"",0.1,1};
};
```

#### P

##### padding

**Type:** Number

**Description:** n/a

```cpp
padding = 0.004;
```

##### period

**Type:** Number

**Description:** Time it takes to pulsate between the select colors.

```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 = "((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
```

##### rows

**Type:** Number

**Description:** n/a

```cpp
rows = 25;
```

#### S

##### selectWithRMB

**Type:** Number

**Description**

Enable row selection with the right mouse button.

> [!NOTE]
> **Arma 3:** Since Arma 3 v2.00.

```cpp
selectWithRMB = 0;
```

##### shadowPictureLeft

**Type:** Number

**Description:** n/a

```cpp
shadowPictureLeft = 0;
```

##### shadowPictureRight

**Type:** Number

**Description:** n/a

```cpp
shadowPictureRight = 0;
```

##### shadowTextLeft

**Type:** Number

**Description:** n/a

```cpp
shadowTextLeft = 0;
```

##### shadowTextRight

**Type:** Number

**Description:** n/a

```cpp
shadowTextRight = 0;
```

##### soundSelect

**Type:** Array

**Description:** n/a

```cpp
soundSelect[] = {"",0.1,1};
```

##### soundSelect

**Type:** Array

**Description:** n/a

```cpp
soundSelect[] = {"",0.1,1};
```

#### T

##### tooltipPerColumn

**Type:** Boolean

**Description**

If set to [true](../commands/true.md), each cell can have a different tooltip. (Optional - default: [false](../commands/false.md))

> [!NOTE]
> **Arma 3:** Since Arma 3 v2.01.147037.

```cpp
tooltipPerColumn = true;
```

### 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).

#### RscListNBox

```cpp
class RscListNBox
{
    deletable = 0;
    fade = 0;
    access = 0;
    type = CT_LISTNBOX;
    rowHeight = 0;
    colorText[] = {1,1,1,1};
    colorScrollbar[] = {0.95,0.95,0.95,1};
    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,1};
    maxHistoryDelay = 1;
    soundSelect[] =
    {
        "",
        0.1,
        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)";
    drawSideArrows = 0;
    columns[] = {0.3,0.6,0.7};
    idcLeft = -1;
    idcRight = -1;
    class ListScrollBar : ScrollBar
    {
    };
    style = ST_MULTI;
    shadow = 0;
    font = "RobotoCondensed";
    sizeEx = GUI_TEXT_SIZE_MEDIUM;
    color[] = {0.95,0.95,0.95,1};
    colorDisabled[] = {1,1,1,0.25};
    colorPicture[] = {1,1,1,1};
    colorPictureSelected[] = {1,1,1,1};
    colorPictureDisabled[] = {1,1,1,1};
    period = 1.2;
    x = 0;
    y = 0;
    w = 0.3;
    h = 0.3;
    class ScrollBar : ScrollBar
    {
    };
};
```

### Other Examples

```cpp
class RscListNBox
{
  access = 0;
  type = CT_LISTNBOX;// 102;
  style =ST_MULTI;
  w = 0.4;   h = 0.4;
  font = "TahomaB";
  sizeEx = 0.04;
  colorText[] = {0.8784, 0.8471, 0.651, 1};
  colorBackground[] = {0, 0, 0, 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)";
  columns[] = {0.3, 0.6, 0.7};
  color[] = {1, 1, 1, 1};
  colorScrollbar[] = {0.95, 0.95, 0.95, 1};
  colorSelect[] = {0.95, 0.95, 0.95, 1};
  colorSelect2[] = {0.95, 0.95, 0.95, 1};
  colorSelectBackground[] = {0, 0, 0, 1};
  colorSelectBackground2[] = {0.8784, 0.8471, 0.651, 1};
  drawSideArrows = 0;
  idcLeft = -1;
  idcRight = -1;
  maxHistoryDelay = 1;
  rowHeight = 0;
  soundSelect[] = {"", 0.1, 1};
  period = 1;
  shadow = 2;
  class ScrollBar
  {
    arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)";
    arrowFull = "#(argb,8,8,3)color(1,1,1,1)";
    border = "#(argb,8,8,3)color(1,1,1,1)";
    color[] = {1,1,1,0.6};
    colorActive[] = {1,1,1,1};
    colorDisabled[] = {1,1,1,0.3};
    thumb = "#(argb,8,8,3)color(1,1,1,1)";
  };
};
```

### Scripting Example

As for invisible data processing, [lnbAddArray](../commands/lnbAddArray.md), [lnbAddColumn](../commands/lnbAddColumn.md), [lnbData](../commands/lnbData.md), [lnbGetColumnsPosition](../commands/lnbGetColumnsPosition.md), [lnbSetColumnsPos](../commands/lnbSetColumnsPos.md), [lnbSetData](../commands/lnbSetData.md), [lnbSetText](../commands/lnbSetText.md), [lnbSetValue](../commands/lnbSetValue.md), [lnbText](../commands/lnbText.md) and [lnbValue](../commands/lnbValue.md) store data types into exact position of the [CT_LISTNBOX](../topics/CT_LISTNBOX.md) with different spaces. Accessing data with coordinate command at nearly the same syntax:

```sqf
// Set same value to one position of a Control
_ctrl lnbSetData [[0,0],"#1"];
lnbSetColumnsPos [102,[0,1],1];
_ctrl lnbSetText [[0,1], "#1"];
_ctrl lnbSetValue [[0,0],1];
// Accessing the value disregard affecting one another
_ctrl lnbData [0,0]; // "#1"
lnbGetColumnsPosition _ctrl; // [1];
_ctrl lnbText [0,0]; // "#1"
_ctrl lnbValue [0,0]; // 1
```

For a direct visible control over [CT_LISTNBOX](../topics/CT_LISTNBOX.md):

| Code | Pictures |
|---|---|
| ```sqf<br>[_CT_LISTNBOX] spawn {<br>    disableSerialization;<br>    params ["_CT_LISTNBOX"];<br>    {<br>        _CT_LISTNBOX lnbAddRow [getText (_x >> "displayNameShort"), getText (_x >> "displayName")];<br>        _CT_LISTNBOX lnbSetPicture [[_foreachIndex, 0],getText (_x >> "texture")];<br>    } forEach ("true" configClasses (configFile >> "CfgRanks"));<br>    _CT_LISTNBOX lnbSetCurSelRow 0;<br>    private _current = lnbCurSelRow _CT_LISTNBOX;<br>    private _color = _CT_LISTNBOX lnbColor [_current, 0];<br>    _CT_LISTNBOX lnbSetColor [[_current, 1], [(_color select 0) / 2, 0, 0, 1]];<br>    _CT_LISTNBOX lnbDeleteColumn 0;<br>    _CT_LISTNBOX lnbDeleteRow 1;<br>    sleep 1;<br>    lnbClear _CT_LISTNBOX; // Clear all items but control still remains just invisible<br>};<br>``` |  |

### BIS_fnc_initListNBoxSorting Example

[BIS_fnc_initListNBoxSorting](../functions/BIS_fnc_initListNBoxSorting.md) can be used to create a sortable [CT_LISTNBOX](../topics/CT_LISTNBOX.md). To that end, two separate [CT_LISTNBOX](../topics/CT_LISTNBOX.md) controls are required: One filter control and one content control. The filter control becomes the header of the sortable [CT_LISTNBOX](../topics/CT_LISTNBOX.md).

This example demonstrates the basic steps and components needed to create a sortable [CT_LISTNBOX](../topics/CT_LISTNBOX.md). See [BIS_fnc_initListNBoxSorting](../functions/BIS_fnc_initListNBoxSorting.md) to learn more about additional features of that function.

```cpp
import ctrlListNBox; //This base class comes with vanilla Arma 3 and is of type CT_LISTNBOX.

class ExampleDialog {
    idd = 12345;
    onLoad = "_this call TAG_fnc_initListNBoxCtrls;";
    //...

    class ControlsBackground {
        //...
    };

    class Controls {
        class Filter : ctrlListNBox {
            idc = 100;
            x = 0;
            y = 0.045;
            w = 1;
            h = 0.04;
        };

        class Content : ctrlListNBox {
            idc = 101;
            disableOverflow = 1;
            tooltipPerColumn = 1;
            x = 0;
            y = 0.085;
            w = 1;
            h = 0.87;
        };

        //...
    };
};
```

The `TAG_fnc_initListNBoxCtrls` function (called from the [onLoad](../topics/User_Interface_Event_Handlers.md#onload) UI Event Handler):

```sqf
disableSerialization;

params ["_parentDisplay"];

private _filterCtrl = _parentDisplay displayCtrl 100;
private _contentCtrl = _parentDisplay displayCtrl 101;

// Add columns:
{
    _x lnbAddColumn 0.5;
} forEach [_filterCtrl, _contentCtrl];

// Add column headers:
_filterCtrl lnbAddRow ["Name", "Group"];

// Add content rows:
{
    _contentCtrl lnbAddRow [name _x, groupId group _x];
} forEach allUnits;

[_filterCtrl, _contentCtrl] call BIS_fnc_initListNBoxSorting;

ctrlSetFocus _contentCtrl; // Without this line, the user has to click _contentCtrl first in order to use the sorting buttons.
```

<sub>Source: [BI Community Wiki — CT LISTNBOX](https://community.bistudio.com/wiki/CT_LISTNBOX) (revision 376157).</sub>
