RadioButton


Summary

Reporesents the Radiobutton chart control type.

Syntax

public class RadioButton : Control

Members

NameTypeSummary
Checked EventOccurs when checked.
Click EventOccurs when clicked.
Content PropertyGets or sets the content.
GroupName PropertyGets or sets the name of the group.
IsChecked PropertyDefines if the radiobutton is checked.
RadioButton MethodInitializes a new instance of the Radiobutton class.
Text PropertyGets or sets the text.
Unchecked EventOccurs when unchecked.

Example 1

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