Summary
Represents the text box class.
Syntax
public class TextBox : Control
Members
Name | Type | Summary |
---|---|---|
AcceptsReturn | Property | Gets or sets a value that indicates how the text editing control responds when the user presses the ENTER key. |
AcceptsTab | Property | Gets or sets a value that indicates how the text editing control responds when the user presses the TAB key. |
BorderColor | Property | Gets or sets the color of the text box border. |
BorderThickness | Property | 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". |
CaretColor | Property | Gets or sets the color of the insertion caret. |
CharacterCasing | Property | Gets or sets whether the TextBox control modifies the case of characters as they are typed. |
HorizontalScrollBarVisibility | Property | Defines the horizontal scroll bar visibility. |
IsReadOnly | Property | Gets or sets a value indicating whether the current text box is read-only. |
IsReadOnlyCaretVisible | Property | Gets or sets a value that indicates whether a read-only text box displays a caret. |
MaxLength | Property | Gets or sets the maximum number of characters that can be manually entered into the text box. |
MaxLines | Property | Gets or sets the maximum number of visible lines. |
MinLines | Property | Gets or sets the minimum number of visible lines. |
SelectionColor | Property | Gets or sets the text color of the current text selection. |
SelectionOpacity | Property | Gets or sets the opacity of the selected text. |
Text | Property | Gets or sets the text. |
TextAlignment | Property | Gets or sets a value that indicates the horizontal alignment of text content. |
TextBox | Method | Initializes a new instance of the TextBox class. |
TextChanged | Event | Occurs when the text has changed. |
TextWrapping | Property | Gets or sets how the text box should wrap text. |
VerticalScrollBarVisibility | Property | Defines the vertical scroll bar visibility. |
Example 1
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) { } } }