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

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

# TextBlock.Text

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

### Returns

`string` — 

### Examples

C#:

```csharp
var textBlock = new TextBlock();
textBlock.Text = string.Format("Spread: {0:F1} pips", Symbol.Spread / Symbol.PipSize);
Chart.AddControl(textBlock);
Print(textBlock.Text);
```

Python:

```python
textBlock = TextBlock()
textBlock.Text = f"Spread: {api.Symbol.Spread / api.Symbol.PipSize:.1f} pips"
api.Chart.AddControl(textBlock)
api.Print(textBlock.Text)
```

