---
id: "M:cAlgo.API.Panel.HasChild(cAlgo.API.ControlBase)"
kind: "method"
type: "T:cAlgo.API.Panel"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Panel/HasChild/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# Panel.HasChild

Member of [Panel](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Panel/index.md).

## HasChild(ControlBase child)

Returns True if panel has passed child otherwise false.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Accepted without error but never displayed, so control events such as Click are never raised.
- Cloud: Accepted without error but never displayed, so control events such as Click are never raised.

C#:

```csharp
public bool HasChild(ControlBase child)
```

Python:

```python
panel.HasChild(child: ControlBase) -> bool
```

### Parameters

- `child` (`ControlBase`, Python `ControlBase`): Child control

### Returns

`bool` — bool

Available since cAlgo.API 5.4.

### Examples

C#:

```csharp
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));
```

Python:

```python
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)}")
```

