Skip to content

TextBox

Summary

Represents the text box class.

Signature

1
public class TextBox : Control

Namespace

cAlgo.API

Properties

Name Description
IsReadOnly { get; set; } Gets or sets a value indicating whether the current text box is read-only.
AcceptsReturn { get; set; } Gets or sets a value that indicates how the text editing control responds when the user presses the ENTER key.
AcceptsTab { get; set; } Gets or sets a value that indicates how the text editing control responds when the user presses the TAB key.
Text { get; set; } Gets or sets the text.
MinLines { get; set; } Gets or sets the minimum number of visible lines.
MaxLines { get; set; } Gets or sets the maximum number of visible lines.
MaxLength { get; set; } Gets or sets the maximum number of characters that can be manually entered into the text box.
CaretColor { get; set; } Gets or sets the color of the insertion caret.
SelectionColor { get; set; } Gets or sets the text color of the current text selection.
BorderColor { get; set; } Gets or sets the color of the text box border.
SelectionOpacity { get; set; } Gets or sets the opacity of the selected text.
BorderThickness { get; set; } 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".
IsReadOnlyCaretVisible { get; set; } Gets or sets a value that indicates whether a read-only text box displays a caret.
CharacterCasing { get; set; } Gets or sets whether the TextBox control modifies the case of characters as they are typed.
TextAlignment { get; set; } Gets or sets a value that indicates the horizontal alignment of text content.
TextWrapping { get; set; } Gets or sets how the text box should wrap text.
HorizontalScrollBarVisibility { get; set; } Defines the horizontal scroll bar visibility.
VerticalScrollBarVisibility { get; set; } Defines the vertical scroll bar visibility.

Events

Name Description
TextChanged Occurs when the text has changed.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 using cAlgo.API;
 namespace cAlgo
 {
     // This sample indicator shows how to add a text box control on your chart
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class TextBoxSample : Indicator
     {
         protected override void Initialize()
         {
             var stackPanel = new StackPanel
             {
                 BackgroundColor = Color.Gold,
                 HorizontalAlignment = HorizontalAlignment.Center,
                 VerticalAlignment = VerticalAlignment.Center,
                 Opacity = 0.6,
             };
             var textBox = new TextBox
             {
                 Text = "Enter text here...",
                 FontWeight = FontWeight.ExtraBold,
                 Margin = 5,
                 ForegroundColor = Color.White,
                 HorizontalAlignment = HorizontalAlignment.Center,
                 Width = 150
             };
             textBox.TextChanged += TextBox_TextChanged;
             stackPanel.AddChild(textBox);
             Chart.AddControl(stackPanel);
         }
         private void TextBox_TextChanged(TextChangedEventArgs obj)
         {
             Print("Text box text changed to: ", obj.TextBox.Text);
         }
         public override void Calculate(int index)
         {
         }
     }
 }

Last update: September 26, 2022

Comments