---
name: "CT XLISTBOX"
type: topic
source: https://community.bistudio.com/wiki/CT_XLISTBOX
revid: 258316
updated: 2021-05-25T08:59:30Z
---

# CT XLISTBOX

### Introduction

Sideways listbox with only one entry visible at a time. More similar to [CT_COMBO](../topics/CT_COMBO.md). This control should probably not be used at all because of its poor usability. The user has to click through all entries to find the correct one. Use [CT_TOOLBOX](../topics/CT_TOOLBOX.md), [CT_COMBO](../topics/CT_COMBO.md) or [CT_LISTBOX](../topics/CT_LISTBOX.md) instead.

#### 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_XLISTBOX 42
```

#### A

##### arrowEmpty

**Type:** String

**Description:** n/a

```cpp
arrowEmpty = "\A3\ui_f\data\gui\cfg\slider\arrowEmpty_ca.paa";
```

##### arrowFull

**Type:** String

**Description:** n/a

```cpp
arrowFull = "\A3\ui_f\data\gui\cfg\slider\arrowFull_ca.paa";
```

#### B

##### border

**Type:** String

**Description:** n/a

```cpp
border = "\A3\ui_f\data\gui\cfg\slider\border_ca.paa";
```

#### C

##### color

**Type:** Array

**Description:** n/a

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

##### colorActive

**Type:** Array

**Description:** n/a

```cpp
colorActive[] = {1,1,1,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};
```

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

##### colorSelect

**Type:** Array

**Description:** n/a

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

##### cycle

**Type:** Number

**Description:** n/a

```cpp
cycle = 1;
```

#### I

##### Items

**Type:** Class

**Description:** List of default items. Supports most Listbox commands as a config entry.

```cpp
class Items
{
    class Item0
    {
        text = "LOL";
        picture = "\a3\Ui_f\data\Map\Markers\Military\warning_CA.paa";
        color[] = {1,0,1,1};
        colorPicture[] = {0,1,1,1};
        data = "WTF";
        value = 42;
        default = 0;
    };
    class AnotherItem
    {
        text = "O RLY";
        default = 1;
    };
};
```

#### S

##### soundSelect

**Type:** Array

**Description:** n/a

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

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

#### RscXListBox

```cpp
class RscXListBox
{
    deletable = 0;
    fade = 0;
    idc = -1;
    type = CT_XLISTBOX;
    x = 0.1;
    y = 0.1;
    color[] = {1,1,1,0.6};
    colorActive[] = {1,1,1,1};
    colorDisabled[] = {1,1,1,0.25};
    colorSelect[] = {0.95,0.95,0.95,1};
    colorText[] = {1,1,1,1};
    soundSelect[] =
    {
        "\A3\ui_f\data\sound\RscListbox\soundSelect",
        0.09,
        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};
    tooltipColorText[] = {1,1,1,1};
    tooltipColorBox[] = {1,1,1,1};
    tooltipColorShade[] = {0,0,0,0.65};
    style = ST_CENTER + LB_TEXTURES + SL_HORZ;
    shadow = 2;
    arrowEmpty = "\A3\ui_f\data\gui\cfg\slider\arrowEmpty_ca.paa";
    arrowFull = "\A3\ui_f\data\gui\cfg\slider\arrowFull_ca.paa";
    border = "\A3\ui_f\data\gui\cfg\slider\border_ca.paa";
    w = 0.14706;
    h = 0.039216;
    font = "RobotoCondensed";
    sizeEx = GUI_TEXT_SIZE_MEDIUM;
};
```

### Other examples

```cpp
class _CT_XLISTBOX
{
  access = 0; // Control access (0 - ReadAndWrite, 1 - ReadAndCreate, 2 - ReadOnly, 3 - ReadOnlyVerified)
  idc = CT_XLISTBOX; // Control identification (without it, the control won't be displayed)
  type = CT_XLISTBOX; // Type is 42
  style = SL_HORZ + ST_CENTER + LB_TEXTURES; // Style
  default = 0; // Control selected by default (only one within a display can be used)
  blinkingPeriod = 0; // Time in which control will fade out and back in. Use 0 to disable the effect.

  x = 12 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X; // Horizontal coordinates
  y = 17 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y; // Vertical coordinates
  w = 10 * GUI_GRID_CENTER_W; // Width
  h = 1 * GUI_GRID_CENTER_H; // Height

  color[] = {1,1,1,1}; // Arrow color
  colorActive[] = {1,0.5,0,1}; // Selected arrow color

  sizeEx = GUI_GRID_CENTER_H; // Text size
  font = GUI_FONT_NORMAL; // Font from CfgFontFamilies
  shadow = 0; // Shadow (0 - none, 1 - N/A, 2 - black outline)
  colorText[] = {1,1,1,1}; // Text color
  colorSelect[] = {1,0.5,0,1}; // Selected text color
  colorDisabled[] = {1,1,1,0.5}; // Disabled text color

  tooltip = "CT_XLISTBOX"; // Tooltip text
  tooltipColorShade[] = {0,0,0,1}; // Tooltip background color
  tooltipColorText[] = {1,1,1,1}; // Tooltip text color
  tooltipColorBox[] = {1,1,1,1}; // Tooltip frame color

  arrowEmpty = "\A3\ui_f\data\gui\cfg\slider\arrowEmpty_ca.paa"; // Arrow
  arrowFull = "\A3\ui_f\data\gui\cfg\slider\arrowFull_ca.paa"; // Arrow when clicked on
  border = "\A3\ui_f\data\gui\cfg\slider\border_ca.paa"; // Fill texture

  soundSelect[] = {"\A3\ui_f\data\sound\RscListbox\soundSelect",0.09,1}; // Sound played when an item is selected

  onCanDestroy = "systemChat str ['onCanDestroy',_this]; true";
  onDestroy = "systemChat str ['onDestroy',_this]; false";
  onSetFocus = "systemChat str ['onSetFocus',_this]; false";
  onKillFocus = "systemChat str ['onKillFocus',_this]; false";
  onKeyDown = "systemChat str ['onKeyDown',_this]; false";
  onKeyUp = "systemChat str ['onKeyUp',_this]; false";
  onMouseButtonDown = "systemChat str ['onMouseButtonDown',_this]; false";
  onMouseButtonUp = "systemChat str ['onMouseButtonUp',_this]; false";
  onMouseButtonClick = "systemChat str ['onMouseButtonClick',_this]; false";
  onMouseButtonDblClick = "systemChat str ['onMouseButtonDblClick',_this]; false";
  onMouseZChanged = "systemChat str ['onMouseZChanged',_this]; false";
  onMouseMoving = "";
  onMouseHolding = "";

  onLBSelChanged = "systemChat str ['onLBSelChanged',_this]; false";
  onLBDblClick = "systemChat str ['onLBDblClick',_this]; false";
};
```

<sub>Source: [BI Community Wiki — CT XLISTBOX](https://community.bistudio.com/wiki/CT_XLISTBOX) (revision 258316).</sub>
