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

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

# TextBox.MaxLines

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

## MaxLines

Gets or sets the maximum number of visible lines.

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

Python:

```python
textBox.MaxLines: int
```

### Returns

`int` — 

### Examples

C#:

```csharp
var logTextBox = new TextBox { AcceptsReturn = true, MaxLines = 4, IsReadOnly = true };
Chart.AddControl(logTextBox);
Print("Maximum lines: {0}", logTextBox.MaxLines);
```

Python:

```python
logTextBox = TextBox()
logTextBox.AcceptsReturn = True
logTextBox.MaxLines = 4
logTextBox.IsReadOnly = True
api.Chart.AddControl(logTextBox)
api.Print(f"Maximum lines: {logTextBox.MaxLines}")
```

