Skip to content

RadioButton

Summary

Reporesents the Radiobutton chart control type.

Signature

1
public class RadioButton : Control

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
42
43
44
45
46
47
 using cAlgo.API;
 namespace cAlgo
 {
     // This sample shows how to use the Radio button chart control
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class RadioButtonSample : Indicator
     {
         protected override void Initialize()
         {
             var stackPanel = new StackPanel
             {
                 HorizontalAlignment = HorizontalAlignment.Center,
                 VerticalAlignment = VerticalAlignment.Center,
                 BackgroundColor = Color.Gold,
                 Opacity = 0.7
             };
             var firstRadioButton = new RadioButton
             {
                 Text = "Unchecked"
             };
             firstRadioButton.Checked += RadioButton_Checked;
             firstRadioButton.Unchecked += RadioButton_Unchecked;
             stackPanel.AddChild(firstRadioButton);
             var secondRadioButton = new RadioButton
             {
                 Text = "Unchecked"
             };
             secondRadioButton.Checked += RadioButton_Checked;
             secondRadioButton.Unchecked += RadioButton_Unchecked;
             stackPanel.AddChild(secondRadioButton);
             Chart.AddControl(stackPanel);
         }
         private void RadioButton_Unchecked(RadioButtonEventArgs obj)
         {
             var radioButton = obj.RadioButton;
             radioButton.Text = "Unchecked";
         }
         private void RadioButton_Checked(RadioButtonEventArgs obj)
         {
             var radioButton = obj.RadioButton;
             radioButton.Text = "Checked";
         }
         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
24
25
 import clr
 clr.AddReference("cAlgo.API")
 from cAlgo.API import *
 class Test():
     def initialize(self):
         stackPanel = StackPanel()
         stackPanel.HorizontalAlignment = HorizontalAlignment.Center
         stackPanel.VerticalAlignment = VerticalAlignment.Center
         stackPanel.BackgroundColor = Color.Gold
         stackPanel.Opacity = 0.7
         firstRadioButton = RadioButton()
         firstRadioButton.Text = "Unchecked"
         firstRadioButton.Checked += self.on_radio_button_checked
         firstRadioButton.Unchecked += self.on_radio_button_unchecked
         stackPanel.AddChild(firstRadioButton)
         secondRadioButton = RadioButton()
         secondRadioButton.Text = "Unchecked"
         secondRadioButton.Checked += self.on_radio_button_checked
         secondRadioButton.Unchecked += self.on_radio_button_unchecked
         stackPanel.AddChild(secondRadioButton)
         api.Chart.AddControl(stackPanel)
     def on_radio_button_checked(self, args):
         args.RadioButton.Text = "Checked"
     def on_radio_button_unchecked(self, args):
         args.RadioButton.Text = "Unchecked"

See Also

Properties

IsChecked

Summary

Defines if the radiobutton is checked.

Signature

1
public bool IsChecked {get; set;}

Return Value

bool

Text

Summary

Gets or sets the text.

Signature

1
public string Text {get; set;}

Return Value

string

Content

Summary

Gets or sets the content.

Signature

1
public ControlBase Content {get; set;}

Return Value

ControlBase

GroupName

Summary

Gets or sets the name of the group.

Signature

1
public string GroupName {get; set;}

Return Value

string

Events

Click

Summary

Occurs when clicked.

Signature

1
public event Action<RadioButtonEventArgs> Click;

Checked

Summary

Occurs when checked.

Signature

1
public event Action<RadioButtonEventArgs> Checked;

Unchecked

Summary

Occurs when unchecked.

Signature

1
public event Action<RadioButtonEventArgs> Unchecked;