Skip to content

RadioButton

Summary

Reporesents the Radiobutton chart control type.

Signature

1
public class RadioButton : Control

Namespace

cAlgo.API

Properties

Name Description
IsChecked { get; set; } Defines if the radiobutton is checked.
Text { get; set; } Gets or sets the text.
Content { get; set; } Gets or sets the content.
GroupName { get; set; } Gets or sets the name of the group.

Events

Name Description
Click Occurs when clicked.
Checked Occurs when checked.
Unchecked Occurs when unchecked.

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)
         {
         }
     }
 }

See Also


Last update: December 7, 2022

Comments