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

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

# ControlBase.IsEnabled

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

## IsEnabled

Gets or sets the value indicating whether this instance of the chart control is enabled.

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 bool IsEnabled {get; set;}
```

Python:

```python
controlBase.IsEnabled: bool
```

### Returns

`bool` — 

### Examples

C#:

```csharp
var button = new Button { Text = "Buy" };
button.IsEnabled = Positions.Count == 0;
Chart.AddControl(button);
Print("Buy button enabled: {0}", button.IsEnabled);
```

Python:

```python
button = Button()
button.Text = "Buy"
button.IsEnabled = api.Positions.Count == 0
api.Chart.AddControl(button)
api.Print(f"Buy button enabled: {button.IsEnabled}")
```

