Skip to content

RadioButtonEventArgs

class cAlgo.API

DesktopCLICloud

Represents the radio button actions.

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 class RadioButtonEventArgs

Namespace: cAlgo.API · Group: EventArgs

Examples

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)
        {
        }
    }
}
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
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true
}

Properties

Name Description
RadioButtonDesktopCLICloudRadioButton Gets the radiobutton data.

See also