Represents the Text Block - the control to display a non-interactive text.


public class TextBlock : Control


LineHeight PropertyGets or sets the height of the line.
LineStackingStrategy PropertyGets or sets the mechanism by which a line box is determined for each line of text within the TextBlock.
Text PropertyGets or sets the text.
TextAlignment PropertyGets or sets the text alignment.
TextBlock MethodInitializes a new instance of the Text Block class.
TextTrimming PropertyGets or sets the text trimming behavior when the content overflows the content area.
TextWrapping PropertyGets or sets the way how the TextBlock should wrap the text.

Example 1

using cAlgo.API;
namespace cAlgo
    // This sample indicator shows how to add a text block control on your chart
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class TextBlockSample : Indicator
        [Parameter("Text", DefaultValue = "Sample text")]
        public string Text { get; set; }
        protected override void Initialize()
            var stackPanel = new StackPanel
                BackgroundColor = Color.Gold,
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center,
                Opacity = 0.6,
                Width = 200
            stackPanel.AddChild(new TextBlock { Text = Text, FontWeight = FontWeight.ExtraBold, ForegroundColor = Color.Blue });
        public override void Calculate(int index)