Skip to content

RadioButtonEventArgs

Summary

Represents the radio button actions.

Signature

1
public class RadioButtonEventArgs

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 using cAlgo.API;
 namespace cAlgo
 {
     // This example shows how to use the RadioButtonEventArgs
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public 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)
         {
         }
     }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 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

See Also

Properties

RadioButton

Summary

Gets the radiobutton data.

Signature

1
public RadioButton RadioButton {get;}

Return Value

RadioButton

Related Tutorials