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

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

# RadioButtonEventArgs (class)

Represents the radio button actions.

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

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

## Definition

```csharp
public class RadioButtonEventArgs
```

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo
{
    // This example shows how to use the RadioButtonEventArgs
    public partial class RadioButtonEventArgsSample : Indicator
    {
        protected override void Initialize()
        {
            var firstRadioButton = new RadioButton
            {
                Text = "First Radio Button"
            };

            firstRadioButton.Checked += OnRadioButtonChanged;
            firstRadioButton.Unchecked += OnRadioButtonChanged;

            var secondRadioButton = new RadioButton
            {
                Text = "Second Radio Button"
            };

            secondRadioButton.Checked += OnRadioButtonChanged;
            secondRadioButton.Unchecked += OnRadioButtonChanged;

            var panel = new StackPanel
            {
                Orientation = Orientation.Vertical,
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center,
            };

            panel.AddChild(firstRadioButton);
            panel.AddChild(secondRadioButton);

            Chart.AddControl(panel);
        }

        private void OnRadioButtonChanged(RadioButtonEventArgs obj)
        {
            var state = obj.RadioButton.IsChecked ? "Checked" : "Unchecked";

            obj.RadioButton.Text = state;
        }

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

Python:

```python
import clr
clr.AddReference("cAlgo.API")

from cAlgo.API import *

class Test():
    def initialize(self):
        firstRadioButton = RadioButton()
        firstRadioButton.Text = "First Radio Button"

        firstRadioButton.Checked += self.on_radio_button_changed
        firstRadioButton.Unchecked += self.on_radio_button_changed

        secondRadioButton = RadioButton()
        secondRadioButton.Text = "Second Radio Button"

        secondRadioButton.Checked += self.on_radio_button_changed
        secondRadioButton.Unchecked += self.on_radio_button_changed

        panel = StackPanel()
        panel.Orientation = Orientation.Vertical
        panel.HorizontalAlignment = HorizontalAlignment.Center
        panel.VerticalAlignment = VerticalAlignment.Center

        panel.AddChild(firstRadioButton)
        panel.AddChild(secondRadioButton)

        api.Chart.AddControl(panel)

    def on_radio_button_changed(self, args):
        state = "Checked" if args.RadioButton.IsChecked else "Unchecked"
        args.RadioButton.Text = state
```

config.json:

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

## Properties

- `public RadioButton RadioButton {get;}` — Gets the radiobutton data. [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/RadioButtonEventArgs/RadioButton/index.md)

