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

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

# ButtonClickEventArgs.Button

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

## Button

Gets the button data.

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

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

C#:

```csharp
public Button Button {get;}
```

Python:

```python
buttonClickEventArgs.Button: Button
```

### Returns

`Button` — 

### Examples

C#:

```csharp
protected override void OnStart()
{
    var button = new Button { Text = "Buy EURUSD" };
    button.Click += OnButtonClick;
    Chart.AddControl(button);
}

private void OnButtonClick(ButtonClickEventArgs args)
{
    args.Button.IsEnabled = false;
    args.Button.Text = "Order sent";
    ExecuteMarketOrder(TradeType.Buy, "EURUSD", 10000, "myLabel");
}
```

Python:

```python
def on_start(self):
    button = Button()
    button.Text = "Buy EURUSD"
    button.Click += self.on_button_click
    api.Chart.AddControl(button)

def on_button_click(self, args):
    args.Button.IsEnabled = False
    args.Button.Text = "Order sent"
    api.ExecuteMarketOrder(TradeType.Buy, "EURUSD", 10000, "myLabel")
```

