---
id: "M:cAlgo.API.CornerRadius.#ctor(System.Double,System.Double,System.Double,System.Double)"
kind: "constructor"
type: "T:cAlgo.API.CornerRadius"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/Styles/CornerRadius/Constructor/"
---

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

# CornerRadius constructor

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

## CornerRadius(double topLeft, double topRight, double bottomRight, double bottomLeft)

Initializes a new instance of the [`CornerRadius`](https://help.ctrader.com/ctrader-algo/references/Controls/Styles/CornerRadius/index.md) structure.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public CornerRadius(double topLeft, double topRight, double bottomRight, double bottomLeft)
```

Python:

```python
CornerRadius(topLeft: float, topRight: float, bottomRight: float, bottomLeft: float)
```

### Parameters

- `topLeft` (`double`, Python `float`): 
- `topRight` (`double`, Python `float`): 
- `bottomRight` (`double`, Python `float`): 
- `bottomLeft` (`double`, Python `float`):

### Examples

C#:

```csharp
var button = new Button { Text = "Buy", CornerRadius = new CornerRadius(10, 10, 0, 0) };
Chart.AddControl(button);
Print("Top left radius: {0}", button.CornerRadius.TopLeft);
```

Python:

```python
button = Button()
button.Text = "Buy"
button.CornerRadius = CornerRadius(10, 10, 0, 0)
api.Chart.AddControl(button)
api.Print(f"Top left radius: {button.CornerRadius.TopLeft}")
```

## CornerRadius(double uniformRadius)

Initializes a new instance of the [`CornerRadius`](https://help.ctrader.com/ctrader-algo/references/Controls/Styles/CornerRadius/index.md) structure.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public CornerRadius(double uniformRadius)
```

Python:

```python
CornerRadius(uniformRadius: float)
```

### Parameters

- `uniformRadius` (`double`, Python `float`):

### Examples

C#:

```csharp
var border = new Border { CornerRadius = new CornerRadius(8), BorderThickness = 1, BorderColor = Color.Gray, Width = 200, Height = 80 };
Chart.AddControl(border);
```

Python:

```python
border = Border()
border.CornerRadius = CornerRadius(8)
border.BorderThickness = Thickness(1)
border.BorderColor = Color.Gray
border.Width = 200
border.Height = 80
api.Chart.AddControl(border)
```

