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

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

# StackPanel.Orientation

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

## Orientation

Gets or sets the StackPanel orientation.

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

Python:

```python
stackPanel.Orientation: Orientation
```

### Returns

`Orientation` — 

### Examples

C#:

```csharp
var panel = new StackPanel { Orientation = Orientation.Horizontal, VerticalAlignment = VerticalAlignment.Bottom };
panel.AddChild(new Button { Text = "Buy", Margin = 2 });
panel.AddChild(new Button { Text = "Sell", Margin = 2 });
Chart.AddControl(panel);
```

Python:

```python
panel = StackPanel()
panel.Orientation = Orientation.Horizontal
panel.VerticalAlignment = VerticalAlignment.Bottom
for text in ["Buy", "Sell"]:
    button = Button()
    button.Text = text
    panel.AddChild(button)
api.Chart.AddControl(panel)
```

