Skip to content

Border

class cAlgo.API

DesktopCLICloud

Represents the border.

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 Border : ControlBase

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

Examples

using cAlgo.API;

namespace cAlgo
{
    // A sample indicator that shows how to use Border chart control
    public partial class BorderSample : Indicator
    {
        protected override void Initialize()
        {
            var border = new Border
            {
                BorderColor = Color.Yellow,
                BorderThickness = 2,
                Opacity = 0.5,
                BackgroundColor = Color.Violet,
                HorizontalAlignment = HorizontalAlignment.Right,
                VerticalAlignment = VerticalAlignment.Bottom,
                Width = 200,
                Height = 100,
                Margin = 10
            };

            var stackPanel = new StackPanel
            {
                Orientation = Orientation.Vertical
            };

            stackPanel.AddChild(new TextBlock
            {
                Text = "Text",
                Margin = 5,
                HorizontalAlignment = HorizontalAlignment.Center,
                FontWeight = FontWeight.ExtraBold
            });

            stackPanel.AddChild(new Button
            {
                Text = "Button",
                Margin = 5,
                HorizontalAlignment = HorizontalAlignment.Center,
                FontWeight = FontWeight.ExtraBold
            });

            stackPanel.AddChild(new TextBox
            {
                Text = "Type text...",
                Margin = 5,
                HorizontalAlignment = HorizontalAlignment.Center,
                FontWeight = FontWeight.ExtraBold,
                Width = 100
            });

            border.Child = stackPanel;

            Chart.AddControl(border);
        }

        public override void Calculate(int index)
        {
        }
    }
}
import clr
clr.AddReference("cAlgo.API")

from cAlgo.API import *

class Test():
    def initialize(self):
        border = Border()
        border.BorderColor = Color.Yellow
        border.BorderThickness = Thickness(2)
        border.Opacity = 0.5
        border.BackgroundColor = Color.Violet
        border.HorizontalAlignment = HorizontalAlignment.Right
        border.VerticalAlignment = VerticalAlignment.Bottom
        border.Width = 200
        border.Height = 100
        border.Margin = Thickness(10)

        stackPanel = StackPanel()
        stackPanel.Orientation = Orientation.Vertical

        textBlock = TextBlock()
        textBlock.Margin = Thickness(5)
        textBlock.Text = "Text"
        textBlock.FontWeight = FontWeight.ExtraBold
        textBlock.HorizontalAlignment = HorizontalAlignment.Center

        stackPanel.AddChild(textBlock)

        button = Button()
        button.Margin = Thickness(5)
        button.Text = "Button"
        button.FontWeight = FontWeight.ExtraBold
        button.HorizontalAlignment = HorizontalAlignment.Center

        stackPanel.AddChild(button)

        textBox = TextBox()
        textBox.Margin = Thickness(5)
        textBox.FontWeight = FontWeight.ExtraBold
        textBox.HorizontalAlignment = HorizontalAlignment.Center
        textBox.Width = 100
        textBox.Text = "Type text..."

        stackPanel.AddChild(textBox)

        border.Child = stackPanel

        api.Chart.AddControl(border)
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true
}

Constructors

Name Description
BorderDesktopCLICloud Initializes a new instance of the Border class.

Properties

Name Description
BackgroundColorDesktopCLICloudColor Gets or sets the color of the border background. Check the Color class for the ARGB (alpha, red, green, blue) color values, or use the strings Color.Red, Color.FromName("Red"), Color.FromArgb(255, 0, 0), Color.FromHex("#ff0000"), "Red", "#ff0000".
BorderColorDesktopCLICloudColor Gets or sets the border line color. Check the Color class for the ARGB (alpha, red, green, blue) color values, or use the strings Color.Red, Color.FromName("Red"), Color.FromArgb(255, 0, 0), Color.FromHex("#ff0000"), "Red", "#ff0000".
BorderThicknessDesktopCLICloudThickness Gets or sets the border thickness. Property value can be set using Thickness, number, or a string new Thickness(5), new Thickness(1, 2, 3, 4), 5, "5", "1 2 3 4".
ChildDesktopCLICloudControlBase Gets or sets the border child object.
CornerRadiusDesktopCLICloudCornerRadius Gets or sets the border corner radius. Property value can be set using CornerRadius, number, or a string: new CornerRadius(5), new CornerRadius(1, 2, 3, 4).
PaddingDesktopCLICloudThickness Gets or sets the border padding thickness. Property value can be set using Thickness, number, or a string new Thickness(5), new Thickness(1, 2, 3, 4), 5, "5", "1 2 3 4".

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