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

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

# TextBox.IsReadOnly

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

## IsReadOnly

Gets or sets a value indicating whether the current text box is read-only.

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

Python:

```python
textBox.IsReadOnly: bool
```

### Returns

`bool` — 

### Examples

C#:

```csharp
var balanceTextBox = new TextBox { Text = Account.Balance.ToString("F2"), IsReadOnly = true };
Chart.AddControl(balanceTextBox);
```

Python:

```python
balanceTextBox = TextBox()
balanceTextBox.Text = f"{api.Account.Balance:.2f}"
balanceTextBox.IsReadOnly = True
api.Chart.AddControl(balanceTextBox)
```

