Skip to content

RadioButton.IsChecked

property · RadioButton · cAlgo.API

DesktopCLICloud

Defines if the radiobutton is checked.

Environment behaviour

CLI — not supported. Accepted without error but never displayed, so control events such as Click are never raised.

Cloud — not supported. Accepted without error but never displayed, so control events such as Click are never raised.

Definition

public bool IsChecked {get; set;}
radioButton.IsChecked: bool

Returns bool

Examples

var buyRadioButton = new RadioButton { Text = "Buy", GroupName = "Direction", IsChecked = true };
Chart.AddControl(buyRadioButton);
var tradeType = buyRadioButton.IsChecked ? TradeType.Buy : TradeType.Sell;
Print("Trade direction: {0}", tradeType);
buyRadioButton = RadioButton()
buyRadioButton.Text = "Buy"
buyRadioButton.IsChecked = True
api.Chart.AddControl(buyRadioButton)
tradeType = TradeType.Buy if buyRadioButton.IsChecked else TradeType.Sell
api.Print(f"Trade direction: {tradeType}")