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

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

# ToggleButton.Text

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

## Text

Gets or sets the text.

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 string Text {get; set;}
```

Python:

```python
toggleButton.Text: str
```

### Returns

`string` — 

### Examples

C#:

```csharp
var toggleButton = new ToggleButton { Text = "Trading: OFF" };
toggleButton.Checked += args => args.ToggleButton.Text = "Trading: ON";
toggleButton.Unchecked += args => args.ToggleButton.Text = "Trading: OFF";
Chart.AddControl(toggleButton);
```

Python:

```python
toggleButton = ToggleButton()
toggleButton.Text = "Trading: OFF"
api.Chart.AddControl(toggleButton)
api.Print(f"Toggle button text: {toggleButton.Text}")
```

