---
id: "T:cAlgo.API.TextChangedEventArgs"
kind: "class"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/EventArgs/TextChangedEventArgs/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# TextChangedEventArgs (class)

Provides data for the TextChanged event.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Never raised in the CLI: the events that pass it never fire there (TextBox.TextChanged).
- Cloud: Never raised in the cloud: the events that pass it never fire there (TextBox.TextChanged).

## Definition

```csharp
public class TextChangedEventArgs
```

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo
{
    // This sample indicator shows how to use TextChangedEventArgs
    public partial 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: {0}", obj.TextBox.Text);
        }

        public override void Calculate(int index)
        {
        }
    }
}
```

Python:

```python
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}")
```

config.json:

```json
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true
}
```

## Properties

- `public TextBox TextBox {get;}` — Gets the texbox. [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/TextChangedEventArgs/TextBox/index.md)

