Skip to content

TextBox

Summary

Represents the text box class.

Signature

1
public class TextBox : Control

Namespace

cAlgo.API

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)
         {
         }
     }
 }

Properties

IsReadOnly

Summary

Gets or sets a value indicating whether the current text box is read-only.

Signature

1
public bool IsReadOnly {get; set;}

Return Value

bool

AcceptsReturn

Summary

Gets or sets a value that indicates how the text editing control responds when the user presses the ENTER key.

Signature

1
public bool AcceptsReturn {get; set;}

Return Value

bool

AcceptsTab

Summary

Gets or sets a value that indicates how the text editing control responds when the user presses the TAB key.

Signature

1
public bool AcceptsTab {get; set;}

Return Value

bool

Text

Summary

Gets or sets the text.

Signature

1
public string Text {get; set;}

Return Value

string

MinLines

Summary

Gets or sets the minimum number of visible lines.

Signature

1
public int MinLines {get; set;}

Return Value

int

MaxLines

Summary

Gets or sets the maximum number of visible lines.

Signature

1
public int MaxLines {get; set;}

Return Value

int

MaxLength

Summary

Gets or sets the maximum number of characters that can be manually entered into the text box.

Signature

1
public int MaxLength {get; set;}

Return Value

int

CaretColor

Summary

Gets or sets the color of the insertion caret.

Signature

1
public Color CaretColor {get; set;}

Return Value

Color

SelectionColor

Summary

Gets or sets the text color of the current text selection.

Signature

1
public Color SelectionColor {get; set;}

Return Value

Color

BorderColor

Summary

Gets or sets the color of the text box border.

Signature

1
public Color BorderColor {get; set;}

Return Value

Color

SelectionOpacity

Summary

Gets or sets the opacity of the selected text.

Signature

1
public double SelectionOpacity {get; set;}

Return Value

double

BorderThickness

Summary

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".

Signature

1
public Thickness BorderThickness {get; set;}

Return Value

Thickness

IsReadOnlyCaretVisible

Summary

Gets or sets a value that indicates whether a read-only text box displays a caret.

Signature

1
public bool IsReadOnlyCaretVisible {get; set;}

Return Value

bool

CharacterCasing

Summary

Gets or sets whether the TextBox control modifies the case of characters as they are typed.

Signature

1
public CharacterCasing CharacterCasing {get; set;}

Return Value

CharacterCasing

Related Tutorials

TextAlignment

Summary

Gets or sets a value that indicates the horizontal alignment of text content.

Signature

1
public TextAlignment TextAlignment {get; set;}

Return Value

TextAlignment

Related Tutorials

TextWrapping

Summary

Gets or sets how the text box should wrap text.

Signature

1
public TextWrapping TextWrapping {get; set;}

Return Value

TextWrapping

Related Tutorials

HorizontalScrollBarVisibility

Summary

Defines the horizontal scroll bar visibility.

Signature

1
public ScrollBarVisibility HorizontalScrollBarVisibility {get; set;}

Return Value

ScrollBarVisibility

VerticalScrollBarVisibility

Summary

Defines the vertical scroll bar visibility.

Signature

1
public ScrollBarVisibility VerticalScrollBarVisibility {get; set;}

Return Value

ScrollBarVisibility

Events

TextChanged

Summary

Occurs when the text has changed.

Signature

1
public event Action<TextChangedEventArgs> TextChanged;