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

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

# Button.Text

Member of [Button](https://help.ctrader.com/ctrader-algo/references/Controls/Button/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
button.Text: str
```

### Returns

`string` — 

### Examples

C#:

```csharp
var button = new Button { Text = "Start trading" };
button.Click += args => args.Button.Text = args.Button.Text == "Start trading" ? "Stop trading" : "Start trading";
Chart.AddControl(button);
```

Python:

```python
button = Button()
button.Text = "Start trading"
api.Chart.AddControl(button)
api.Print(f"Button text: {button.Text}")
```

