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

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

# Control.Padding

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

## Padding

Gets or sets the chart control padding. Property value can be set using Thickness, number, or a string new Thickness(5), new Thickness(1, 2, 3, 4), 5, "5", "1 2 3 4".

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 Thickness Padding {get; set;}
```

Python:

```python
control.Padding: Thickness
```

### Returns

`Thickness` — 

### Examples

C#:

```csharp
var button = new Button { Text = "Close all positions", Padding = new Thickness(20, 8, 20, 8) };
Chart.AddControl(button);
```

Python:

```python
button = Button()
button.Text = "Close all positions"
button.Padding = Thickness(20, 8, 20, 8)
api.Chart.AddControl(button)
```

