---
id: "M:cAlgo.API.ComboBox.AddItem(System.String)"
kind: "method"
type: "T:cAlgo.API.ComboBox"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/ComboBox/AddItem/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# ComboBox.AddItem

Member of [ComboBox](https://help.ctrader.com/ctrader-algo/references/Controls/ComboBox/index.md).

## AddItem(string item)

Adds a new item to the ComboBox

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Accepted without error but never displayed, so control events such as Click are never raised.
- Cloud: Accepted without error but never displayed, so control events such as Click are never raised.

C#:

```csharp
public void AddItem(string item)
```

Python:

```python
comboBox.AddItem(item: str) -> None
```

### Parameters

- `item` (`string`, Python `str`): The string value that will be added on ComboBox

### Examples

C#:

```csharp
var comboBox = new ComboBox();
foreach (var position in Positions)
    comboBox.AddItem(position.Id.ToString());
Chart.AddControl(comboBox);
```

Python:

```python
comboBox = ComboBox()
for position in api.Positions:
    comboBox.AddItem(str(position.Id))
api.Chart.AddControl(comboBox)
```

