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

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

# ControlBase.MaxWidth

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

## MaxWidth

Gets or sets the maximum width 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 MaxWidth {get; set;}
```

Python:

```python
controlBase.MaxWidth: float
```

### Returns

`double` — 

### Examples

C#:

```csharp
var textBlock = new TextBlock { Text = "A long trading note that wraps when it reaches the maximum width", MaxWidth = 200, TextWrapping = TextWrapping.Wrap };
Chart.AddControl(textBlock);
Print("Maximum width: {0}", textBlock.MaxWidth);
```

Python:

```python
textBlock = TextBlock()
textBlock.Text = "A long trading note that wraps when it reaches the maximum width"
textBlock.MaxWidth = 200
textBlock.TextWrapping = TextWrapping.Wrap
api.Chart.AddControl(textBlock)
api.Print(f"Maximum width: {textBlock.MaxWidth}")
```

