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

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

# ControlBase.Width

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

## Width

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

Python:

```python
controlBase.Width: float
```

### Returns

`double` — The width.

### Examples

C#:

```csharp
var button = new Button { Text = "Close all positions", Width = 160 };
Chart.AddControl(button);
Print("Width: {0}", button.Width);
```

Python:

```python
button = Button()
button.Text = "Close all positions"
button.Width = 160
api.Chart.AddControl(button)
api.Print(f"Width: {button.Width}")
```

