---
id: "P:cAlgo.API.ControlBase.UniqueId"
kind: "property"
type: "T:cAlgo.API.ControlBase"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/UniqueId/"
---

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

# ControlBase.UniqueId

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

## UniqueId

Gets the unique identifier of a chart control.

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 Guid UniqueId {get;}
```

Python:

```python
controlBase.UniqueId: Guid
```

### Returns

`Guid` — 

### Examples

C#:

```csharp
var button = new Button { Text = "Buy" };
Chart.AddControl(button);
Print("Button id: {0}", button.UniqueId);
```

Python:

```python
button = Button()
button.Text = "Buy"
api.Chart.AddControl(button)
api.Print(f"Button id: {button.UniqueId}")
```

