Skip to content

Panel.AddChild

method · Panel · cAlgo.API

DesktopCLICloud

Adds the child element.

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 void AddChild(ControlBase child)
panel.AddChild(child: ControlBase) -> None

Parameters

Name C# type Python type Description
child ControlBase ControlBase The child.

Examples

var panel = new StackPanel { Orientation = Orientation.Horizontal };
var buyButton = new Button { Text = "Buy" };
buyButton.Click += args => ExecuteMarketOrder(TradeType.Buy, SymbolName, Symbol.QuantityToVolumeInUnits(0.01));
panel.AddChild(buyButton);
Chart.AddControl(panel);
panel = StackPanel()
panel.Orientation = Orientation.Horizontal
buyButton = Button()
buyButton.Text = "Buy"
buyButton.Click += lambda args: api.ExecuteMarketOrder(TradeType.Buy, api.SymbolName, api.Symbol.QuantityToVolumeInUnits(0.01))
panel.AddChild(buyButton)
api.Chart.AddControl(panel)