Skip to content

ControlBase.IsEnabled

property · ControlBase · cAlgo.API

DesktopCLICloud

Gets or sets the value indicating whether this instance of the chart control is enabled.

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 IsEnabled {get; set;}
controlBase.IsEnabled: bool

Returns bool

Examples

var button = new Button { Text = "Buy" };
button.IsEnabled = Positions.Count == 0;
Chart.AddControl(button);
Print("Buy button enabled: {0}", button.IsEnabled);
button = Button()
button.Text = "Buy"
button.IsEnabled = api.Positions.Count == 0
api.Chart.AddControl(button)
api.Print(f"Buy button enabled: {button.IsEnabled}")