Skip to content

Panel.HasChild

method · Panel · cAlgo.API Since 5.4

DesktopCLICloud

Returns True if panel has passed child otherwise false.

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 HasChild(ControlBase child)
panel.HasChild(child: ControlBase) -> bool

Parameters

Name C# type Python type Description
child ControlBase ControlBase Child control

Returns bool — bool

Examples

var panel = new StackPanel();
var label = new TextBlock { Text = "Trading paused" };
if (!panel.HasChild(label))
    panel.AddChild(label);
Chart.AddControl(panel);
Print("Has label: {0}", panel.HasChild(label));
panel = StackPanel()
label = TextBlock()
label.Text = "Trading paused"
if not panel.HasChild(label):
    panel.AddChild(label)
api.Chart.AddControl(panel)
api.Print(f"Has label: {panel.HasChild(label)}")