---
id: "P:cAlgo.API.TextChangedEventArgs.TextBox"
kind: "property"
type: "T:cAlgo.API.TextChangedEventArgs"
url: "https://help.ctrader.com/ctrader-algo/references/EventArgs/TextChangedEventArgs/TextBox/"
---

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

# TextChangedEventArgs.TextBox

Member of [TextChangedEventArgs](https://help.ctrader.com/ctrader-algo/references/EventArgs/TextChangedEventArgs/index.md).

## TextBox

Gets the texbox.

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

C#:

```csharp
public TextBox TextBox {get;}
```

Python:

```python
textChangedEventArgs.TextBox: TextBox
```

### Returns

`TextBox` — 

### Examples

C#:

```csharp
protected override void OnStart()
{
    var volumeTextBox = new TextBox { Text = "10000", Width = 100 };
    volumeTextBox.TextChanged += OnVolumeTextChanged;
    Chart.AddControl(volumeTextBox);
}

private void OnVolumeTextChanged(TextChangedEventArgs args)
{
    var isValid = double.TryParse(args.TextBox.Text, out var volume) && volume > 0;
    args.TextBox.ForegroundColor = isValid ? Color.White : Color.Red;
}
```

Python:

```python
def on_start(self):
    volumeTextBox = TextBox()
    volumeTextBox.Text = "10000"
    volumeTextBox.Width = 100
    volumeTextBox.TextChanged += self.on_volume_text_changed
    api.Chart.AddControl(volumeTextBox)

def on_volume_text_changed(self, args):
    try:
        isValid = float(args.TextBox.Text) > 0
    except ValueError:
        isValid = False
    args.TextBox.ForegroundColor = Color.White if isValid else Color.Red
```

