Skip to content

Panel

class cAlgo.API

DesktopCLICloud

Provides a base class for all Panel elements. Use Panel elements to position and arrange child objects.

Environment behaviour

CLI — not supported. Accepted without error but never displayed, so control events such as Click are never raised.

Cloud — not supported. Accepted without error but never displayed, so control events such as Click are never raised.

Definition

public abstract class Panel : ControlBase

Namespace: cAlgo.API · Group: Layout · Inherits: ControlBase

Examples

Panel panel = new StackPanel { BackgroundColor = Color.FromArgb(80, Color.Black), Margin = 10 };
panel.AddChild(new TextBlock { Text = SymbolName });
panel.AddChild(new TextBlock { Text = "Spread: " + Symbol.Spread / Symbol.PipSize });
Chart.AddControl(panel);
Print("Panel children: {0}", panel.ChildCount);
panel = StackPanel()
panel.BackgroundColor = Color.FromArgb(80, Color.Black)
symbolText = TextBlock()
symbolText.Text = api.SymbolName
spreadText = TextBlock()
spreadText.Text = f"Spread: {api.Symbol.Spread / api.Symbol.PipSize}"
panel.AddChild(symbolText)
panel.AddChild(spreadText)
api.Chart.AddControl(panel)
api.Print(f"Panel children: {panel.ChildCount}")

Methods

Name Description
AddChildDesktopCLICloudvoid Adds the child element.
HasChildDesktopCLICloudbool Returns True if panel has passed child otherwise false.
RemoveChildDesktopCLICloudvoid Removes the child element.

Properties

Name Description
BackgroundColorDesktopCLICloudColor Gets or sets the color of the panel background.
ChildCountDesktopCLICloudint Gets count of panel children.
ChildrenDesktopCLICloudIEnumerable<ControlBase> Gets panel children.

Inherited members

From ControlBase: ResetProperty, UniqueId, Style, Left, Top, Right, Bottom, Width, Height, MinWidth, MinHeight, MaxWidth, MaxHeight, IsEnabled, IsVisible, Opacity, Margin, VerticalAlignment, HorizontalAlignment, Dock, IsHitTestVisible

See also