DockPanel
class cAlgo.API
Defines the area where you can arrange child elemens either horizontally or vertically, relative to each other.
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 class DockPanel : Panel
Namespace: cAlgo.API · Group: Layout · Inherits: Panel, ControlBase
Examples
using cAlgo.API;
namespace cAlgo
{
// This sample indicator shows how to use DockPanel
public partial class DockPanelSample : Indicator
{
protected override void Initialize()
{
var dockPanel = new DockPanel
{
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
BackgroundColor = Color.Gold,
Opacity = 0.8
};
dockPanel.AddChild(new TextBlock
{
Text = "Enter Your Name",
Margin = 5,
Dock = Dock.Top,
HorizontalAlignment = HorizontalAlignment.Center,
ForegroundColor = Color.Black,
FontWeight = FontWeight.ExtraBold
});
dockPanel.AddChild(new TextBox
{
Dock = Dock.Bottom,
Margin = 5,
Width = 100
});
Chart.AddControl(dockPanel);
}
public override void Calculate(int index)
{
}
}
}
import clr
clr.AddReference("cAlgo.API")
from cAlgo.API import *
class Test():
def initialize(self):
dockPanel = DockPanel()
dockPanel.HorizontalAlignment = HorizontalAlignment.Center
dockPanel.VerticalAlignment = VerticalAlignment.Center
dockPanel.BackgroundColor = Color.Gold
dockPanel.Opacity = 0.8
textBlock = TextBlock()
textBlock.Text = "Enter Your Name"
textBlock.Margin = Thickness(5)
textBlock.Dock = Dock.Top
textBlock.HorizontalAlignment = HorizontalAlignment.Center
textBlock.ForegroundColor = Color.Black
textBlock.FontWeight = FontWeight.ExtraBold
dockPanel.AddChild(textBlock)
textBox = TextBox()
textBox.Dock = Dock.Bottom
textBox.Margin = Thickness(5)
textBox.Width = 100
dockPanel.AddChild(textBox)
api.Chart.AddControl(dockPanel)
{
"AccessRights": "None",
"TimeZone": "UTC",
"IsOverlay": true
}
Constructors
| Name | Description |
|---|---|
| DockPanelDesktopCLICloud | Initializes a new instance of the DockPanel class. |
Properties
| Name | Description |
|---|---|
LastChildFillDesktopCLICloudbool | Indicates whether the last child element within a DockPanel stretches to fill the remaining available space. |
Inherited members
From Panel: AddChild, RemoveChild, HasChild, BackgroundColor, Children, ChildCount
From ControlBase: ResetProperty, UniqueId, Style, Left, Top, Right, Bottom, Width, Height, MinWidth, MinHeight, MaxWidth, MaxHeight, IsEnabled, IsVisible, Opacity, Margin, VerticalAlignment, HorizontalAlignment, Dock, IsHitTestVisible