---
name: "lbAdd"
type: command
status: ok
groups: ["GUI Control - ListBox"]
arma3_since: "0.50"
locality: {"argument": "local", "effect": "local", "server_exec": false}
source: https://community.bistudio.com/wiki/lbAdd
revid: 369231
updated: 2024-09-03T10:34:56Z
---

# lbAdd

*Command · GUI Control - ListBox · Arma 3 v0.50 · introduced in Operation Flashpoint v1.75*

Locality: arguments **local** · effect **local**

## Description

Adds an item with the given text to the CT_LISTBOX or CT_COMBO or CT_TOOLBOX.

> [!NOTE]
> If using `RscToolBox` as template with [ctrlCreate](../commands/ctrlCreate.md), clear it first with [lbClear](../commands/lbClear.md)

## Syntax

### Syntax 1

```sqf
lbAdd [idc, text]
```

**Parameters:**

- `idc`: [Number](../topics/Number.md) - control IDC
- `text`: [String](../topics/String.md) - visible text

**Returns:** [Number](../topics/Number.md) - index (row) of newly added item

### Syntax 2

```sqf
control lbAdd text
```

**Parameters:**

- `control`: [Control](../topics/Control.md)
- `text`: [String](../topics/String.md)

**Returns:** [Number](../topics/Number.md) - index (row) of newly added item

## Examples

### Example 1

```sqf
_index = lbAdd [101, "First item"];
```

### Example 2

```sqf
_index = _control lbAdd "First item";
```

## See also

[lbDelete](../commands/lbDelete.md) · [lbText](../commands/lbText.md)

<sub>Source: [BI Community Wiki — lbAdd](https://community.bistudio.com/wiki/lbAdd) (revision 369231).</sub>
