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

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

# ControlBase.Style

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

## Style

Gets or sets the style of a 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 Style Style {get; set;}
```

Python:

```python
controlBase.Style: Style
```

### Returns

`Style` — 

### Examples

C#:

```csharp
var style = new Style();
style.Set(ControlProperty.BackgroundColor, Color.DarkGreen);
style.Set(ControlProperty.ForegroundColor, Color.White);
var button = new Button { Text = "Buy", Style = style };
Chart.AddControl(button);
```

Python:

```python
style = Style()
style.Set(ControlProperty.BackgroundColor, Color.DarkGreen)
style.Set(ControlProperty.ForegroundColor, Color.White)
button = Button()
button.Text = "Buy"
button.Style = style
api.Chart.AddControl(button)
```

