Skip to content

TextBox.TextChanged

event · TextBox · cAlgo.API

DesktopCLICloud

Occurs when the text has changed.

Environment behaviour

CLI — not supported. Accepted without error but never displayed, so control events such as Click are never raised.

Cloud — not supported. Accepted without error but never displayed, so control events such as Click are never raised.

Definition

public event Action<TextChangedEventArgs> TextChanged;
textBox.TextChanged += handler  # handler(obj: TextChangedEventArgs)

Examples

var stopLossTextBox = new TextBox { Text = "20", Width = 80 };
stopLossTextBox.TextChanged += args =>
{
    if (double.TryParse(args.TextBox.Text, out var pips))
        Print("Stop loss set to {0} pips", pips);
};
Chart.AddControl(stopLossTextBox);
def on_start(self):
    stopLossTextBox = TextBox()
    stopLossTextBox.Text = "20"
    stopLossTextBox.Width = 80
    stopLossTextBox.TextChanged += self.on_text_changed
    api.Chart.AddControl(stopLossTextBox)

def on_text_changed(self, args):
    api.Print(f"Stop loss input: {args.TextBox.Text}")