Skip to content

RadioButtonEventArgs.RadioButton

property · RadioButtonEventArgs · cAlgo.API

DesktopCLICloud

Gets the radiobutton data.

Environment behaviour

CLI — not supported. Never raised in the CLI: the events that pass it never fire there (RadioButton.Checked, RadioButton.Click, RadioButton.Unchecked).

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

Definition

public RadioButton RadioButton {get;}
radioButtonEventArgs.RadioButton: RadioButton

Returns RadioButton

Examples

protected override void OnStart()
{
    var buyRadioButton = new RadioButton { Text = "Buy", GroupName = "direction" };
    buyRadioButton.Checked += OnRadioButtonChecked;
    Chart.AddControl(buyRadioButton);
}

private void OnRadioButtonChecked(RadioButtonEventArgs args)
{
    Print("Direction selected: {0}, checked: {1}", args.RadioButton.Text, args.RadioButton.IsChecked);
}
def on_start(self):
    buyRadioButton = RadioButton()
    buyRadioButton.Text = "Buy"
    buyRadioButton.GroupName = "direction"
    buyRadioButton.Checked += self.on_radio_button_checked
    api.Chart.AddControl(buyRadioButton)

def on_radio_button_checked(self, args):
    api.Print(f"Direction selected: {args.RadioButton.Text}, checked: {args.RadioButton.IsChecked}")