---
id: "T:cAlgo.API.Dock"
kind: "enum"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Dock/"
---

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

# Dock (enum)

Specifies where a chart control will be docked inside the DockPanel.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public enum Dock
```

## Examples

C#:

```csharp
var dockPanel = new DockPanel { Width = 300, Height = 150, BackgroundColor = Color.DarkSlateGray };
dockPanel.AddChild(new TextBlock { Text = "Top", Dock = Dock.Top });
dockPanel.AddChild(new TextBlock { Text = "Left", Dock = Dock.Left });
dockPanel.AddChild(new TextBlock { Text = "Right", Dock = Dock.Right });
dockPanel.AddChild(new TextBlock { Text = "Bottom", Dock = Dock.Bottom });
Chart.AddControl(dockPanel);
```

Python:

```python
dockPanel = DockPanel()
dockPanel.Width = 300
dockPanel.Height = 150
dockPanel.BackgroundColor = Color.DarkSlateGray
for text, dock in [("Top", Dock.Top), ("Left", Dock.Left), ("Right", Dock.Right), ("Bottom", Dock.Bottom)]:
    textBlock = TextBlock()
    textBlock.Text = text
    textBlock.Dock = dock
    dockPanel.AddChild(textBlock)
api.Chart.AddControl(dockPanel)
```

## Values

- `Dock.Left` — Dock to the left side of the DockPanel.
- `Dock.Top` — Dock to the top of the DockPanel.
- `Dock.Right` — Dock to the right side of the DockPanel.
- `Dock.Bottom` — Dock to the bottom of the DockPanel.

