Skip to content

TextChangedEventArgs

Summary

Provides data for the TextChanged event.

Signature

1
public class TextChangedEventArgs

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 use TextChangedEventArgs
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class Test : 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 += OnTextBoxTextChanged;
             stackPanel.AddChild(textBox);
             Chart.AddControl(stackPanel);
         }
         private void OnTextBoxTextChanged(TextChangedEventArgs obj)
         {
             Print("Text box text changed to: ", obj.TextBox.Text);
         }
         public override void Calculate(int index)
         {
         }
     }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
 import clr
 clr.AddReference("cAlgo.API")
 from cAlgo.API import *
 class Test():    
     def initialize(self):
         stackPanel = StackPanel()
         stackPanel.BackgroundColor = Color.Gold
         stackPanel.HorizontalAlignment = HorizontalAlignment.Center
         stackPanel.VerticalAlignment = VerticalAlignment.Center
         stackPanel.Opacity = 0.6
         textBox = TextBox()
         textBox.Text = "Enter text here..."
         textBox.FontWeight = FontWeight.ExtraBold
         textBox.Margin = Thickness(5)
         textBox.ForegroundColor = Color.White
         textBox.HorizontalAlignment = HorizontalAlignment.Center
         textBox.Width = 150
         textBox.TextChanged += self.on_text_box_changed
         stackPanel.AddChild(textBox)
         api.Chart.AddControl(stackPanel)
     def on_text_box_changed(self, args):
         print(f"Text box text changed to: {args.TextBox.Text}")

See Also

Properties

TextBox

Summary

Gets the texbox.

Signature

1
public TextBox TextBox {get;}

Return Value

TextBox

Related Tutorials