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

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

# Panel.RemoveChild

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

## RemoveChild(ControlBase child)

Removes the child element.

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 void RemoveChild(ControlBase child)
```

Python:

```python
panel.RemoveChild(child: ControlBase) -> None
```

### Parameters

- `child` (`ControlBase`, Python `ControlBase`): The child.

### Examples

C#:

```csharp
var panel = new StackPanel();
var warning = new TextBlock { Text = "Spread is high", ForegroundColor = Color.Red };
panel.AddChild(warning);
Chart.AddControl(panel);
if (Symbol.Spread / Symbol.PipSize < 2)
    panel.RemoveChild(warning);
```

Python:

```python
panel = StackPanel()
warning = TextBlock()
warning.Text = "Spread is high"
warning.ForegroundColor = Color.Red
panel.AddChild(warning)
api.Chart.AddControl(panel)
if api.Symbol.Spread / api.Symbol.PipSize < 2:
    panel.RemoveChild(warning)
```

