---
id: "M:cAlgo.API.CheckBox.#ctor"
kind: "constructor"
type: "T:cAlgo.API.CheckBox"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/CheckBox/Constructor/"
---

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

# CheckBox constructor

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

## CheckBox()

Initializes a new instance of the checkbox class.

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 CheckBox()
```

Python:

```python
CheckBox()
```

### Examples

C#:

```csharp
var checkBox = new CheckBox { Text = "Use trailing stop", IsChecked = true, Margin = 5 };
Chart.AddControl(checkBox);
```

Python:

```python
checkBox = CheckBox()
checkBox.Text = "Use trailing stop"
checkBox.IsChecked = True
checkBox.Margin = Thickness(5)
api.Chart.AddControl(checkBox)
```

