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

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

# WrapPanel (class)

Positions the child elements in sequential position from left to right, breaking content to the next line at the end of the containing box, from top to bottom, or from right to left.

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.

## Definition

```csharp
public class WrapPanel : Panel
```

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo
{
    // This sample shows how to use the WrapPanel
    public partial class WrapPanelSample : Indicator
    {
        protected override void Initialize()
        {
            var wrapPanel = new WrapPanel
            {
                BackgroundColor = Color.Gold,
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center,
                Orientation = PanelOrientation,
                Width = 150,
                Height = 150
            };

            for (int i = 0; i < 10; i++)
            {
                wrapPanel.AddChild(new TextBlock
                {
                    Text = "Text",
                    Margin = 5,
                    ForegroundColor = Color.Black,
                    FontWeight = FontWeight.ExtraBold
                });
            }

            Chart.AddControl(wrapPanel);
        }

        public override void Calculate(int index)
        {
        }
    }
}
```

Python:

```python
import clr
clr.AddReference("cAlgo.API")

from cAlgo.API import *

class Test():
    def initialize(self):
        wrapPanel = WrapPanel()
        wrapPanel.BackgroundColor = Color.Gold
        wrapPanel.HorizontalAlignment = HorizontalAlignment.Center
        wrapPanel.VerticalAlignment = VerticalAlignment.Center
        wrapPanel.Orientation = api.PanelOrientation

        for i in range(10):
            textBlock = TextBlock()
            textBlock.Text = "Text"
            textBlock.Margin = Thickness(5)
            textBlock.ForegroundColor = Color.Black
            textBlock.FontWeight = FontWeight.ExtraBold

            wrapPanel.AddChild(textBlock)

        api.Chart.AddControl(wrapPanel)
```

config.json:

```json
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true,
  "Parameters": [
    {
      "Name": "PanelOrientation",
      "DisplayName": "Panel Orientation",
      "Type": "Enum",
      "EnumTypeFullName": "cAlgo.API.Orientation",
      "DefaultValue": "Vertical"
    }
  ]
}
```

## Constructors

- `public WrapPanel()` — Initializes a new instance of the WrapPanel class. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/WrapPanel/Constructor/index.md)

## Properties

- `public double ItemHeight {get; set;}` — Gets or sets the height of the item. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/WrapPanel/ItemHeight/index.md)
- `public double ItemWidth {get; set;}` — Gets or sets the width of the item. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/WrapPanel/ItemWidth/index.md)
- `public Orientation Orientation {get; set;}` — Gets or sets the orientation of the child element. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/WrapPanel/Orientation/index.md)

## Inherited members

- `public void AddChild(ControlBase child)` (from Panel) [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Panel/AddChild/index.md)
- `public void RemoveChild(ControlBase child)` (from Panel) [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Panel/RemoveChild/index.md)
- `public bool HasChild(ControlBase child)` (from Panel) [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Panel/HasChild/index.md)
- `public Color BackgroundColor {get; set;}` (from Panel) [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Panel/BackgroundColor/index.md)
- `public IEnumerable<ControlBase> Children {get;}` (from Panel) [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Panel/Children/index.md)
- `public int ChildCount {get;}` (from Panel) [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Panel/ChildCount/index.md)
- `public void ResetProperty(ControlProperty property)` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/ResetProperty/index.md)
- `public Guid UniqueId {get;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/UniqueId/index.md)
- `public Style Style {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Style/index.md)
- `public double Left {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Left/index.md)
- `public double Top {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Top/index.md)
- `public double Right {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Right/index.md)
- `public double Bottom {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Bottom/index.md)
- `public double Width {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Width/index.md)
- `public double Height {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Height/index.md)
- `public double MinWidth {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/MinWidth/index.md)
- `public double MinHeight {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/MinHeight/index.md)
- `public double MaxWidth {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/MaxWidth/index.md)
- `public double MaxHeight {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/MaxHeight/index.md)
- `public bool IsEnabled {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/IsEnabled/index.md)
- `public bool IsVisible {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/IsVisible/index.md)
- `public double Opacity {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Opacity/index.md)
- `public Thickness Margin {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Margin/index.md)
- `public VerticalAlignment VerticalAlignment {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/VerticalAlignment/index.md)
- `public HorizontalAlignment HorizontalAlignment {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/HorizontalAlignment/index.md)
- `public Dock Dock {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Dock/index.md)
- `public bool IsHitTestVisible {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/IsHitTestVisible/index.md)

