ToggleButton constructor
constructor · ToggleButton · cAlgo.API
DesktopCLICloud
Initializes a new instance of the Toggle button class.
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 ToggleButton()
ToggleButton()
Examples
var toggleButton = new ToggleButton { Text = "Auto trading", IsChecked = true };
toggleButton.Click += args => Print("Auto trading: {0}", args.ToggleButton.IsChecked);
Chart.AddControl(toggleButton);
toggleButton = ToggleButton()
toggleButton.Text = "Auto trading"
toggleButton.IsChecked = True
toggleButton.Click += lambda args: api.Print(f"Auto trading: {args.ToggleButton.IsChecked}")
api.Chart.AddControl(toggleButton)