---
name: "lbSetCurSel"
type: command
status: ok
groups: ["GUI Control - ListBox"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/lbSetCurSel
revid: 376677
updated: 2025-11-04T00:29:50Z
---

# lbSetCurSel

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

## Description

Selects the item with the given index in the listbox, listnbox, combobox, xcombobox, xlistbox

> [!IMPORTANT]
> **The following only applies to the [Alternative Syntax](../commands/lbSetCurSel.md#syntax-2) when used with CT_LISTBOX and CT_LISTNBOX.**
>
> To deselect all entries, use -1: `_ctrl lbSetCurSel -1;` For listbox of style LB_MULTI use [lbSetSelected](../commands/lbSetSelected.md) instead.
>
> CT_COMBO does not allow deselecting entries, it will instead select the first one as it is not a combobox usual behaviour.
> If you really need to deselect a combobox, see [DreadedEntity's note](../commands/lbSetCurSel.md#notes). For the ComboBox you might as well want to explicitly select index 0 to avoid showing ghost row.

## Syntax

### Syntax 1

```sqf
lbSetCurSel [idc, index]
```

**Parameters:**

- `idc`: [Number](../topics/Number.md) - control's IDC
- `index`: [Number](../topics/Number.md)

**Returns:** [Nothing](../topics/Nothing.md)

### Syntax 2

```sqf
control lbSetCurSel index
```

**Parameters:**

- `control`: [Control](../topics/Control.md)
- `index`: [Number](../topics/Number.md)

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
lbSetCurSel [101, 0];
```

### Example 2

```sqf
_control lbSetCurSel 0;
```

## See also

[lbCurSel](../commands/lbCurSel.md)

## Community notes

**DreadedEntity** — 2014-11-29

**Prior to ArmA 1.90** lbSetCurSel -1 had no effect while the listbox was populated. You needed to use [lbClear](../commands/lbClear.md) first, then lbSetCurSel -1, then re-populate the listbox.

---

**Longbow** — 2015-03-01

Keep in mind that running this command will fire the 'onLBSelChanged' event handler.

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