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

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

# ControlBase.MaxHeight

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

## MaxHeight

Gets or sets the maximum height of the chart control.

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

Python:

```python
controlBase.MaxHeight: float
```

### Returns

`double` — 

### Examples

C#:

```csharp
var scrollViewer = new ScrollViewer { MaxHeight = 150 };
var panel = new StackPanel();
for (var i = 1; i <= 20; i++)
    panel.AddChild(new TextBlock { Text = "Row " + i });
scrollViewer.Content = panel;
Chart.AddControl(scrollViewer);
```

Python:

```python
scrollViewer = ScrollViewer()
scrollViewer.MaxHeight = 150
panel = StackPanel()
for i in range(1, 21):
    row = TextBlock()
    row.Text = f"Row {i}"
    panel.AddChild(row)
scrollViewer.Content = panel
api.Chart.AddControl(scrollViewer)
```

