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

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

# TextBox.TextAlignment

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

## TextAlignment

Gets or sets a value that indicates the horizontal alignment of text content.

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

Python:

```python
textBox.TextAlignment: TextAlignment
```

### Returns

`TextAlignment` — 

### Examples

C#:

```csharp
var priceTextBox = new TextBox { Text = Symbol.Bid.ToString(), Width = 120, TextAlignment = TextAlignment.Right };
Chart.AddControl(priceTextBox);
```

Python:

```python
priceTextBox = TextBox()
priceTextBox.Text = str(api.Symbol.Bid)
priceTextBox.Width = 120
priceTextBox.TextAlignment = TextAlignment.Right
api.Chart.AddControl(priceTextBox)
```

