Click or drag to resize

ControlAssetTemplatePanelChildren Property

Collection of child controls. Add, remove, index, iterate and more using the IControlChildren interface.

Namespace: AxiomCore2.Controls
Assembly: Canary.Axiom.Session (in Canary.Axiom.Session.exe) Version: 24.2.0.25008+ff8e4aa4099a8ee136cc622cd96d64cb655090d8
Syntax
C#
public IControlChildren Children { get; }

Property Value

IControlChildren

Implements

IControlParentChildren
Example

Iterate through collection.

C#
string parentControlName = "Panel1";
IControlParent parentControl = Screen.ScreenControls[parentControlName] as IControlParent;
foreach (IControlBase childControl in parentControl.Children) {
    // code
}

Add control to collection.

C#
// create control
string addControlName = "Button1";
IControlBase addControl = ControlFactory.CreateControl(ControlKind.Button, "Button1");

// add control to parent
string parentControlName = "Panel1";
IControlParent parentControl = Screen.ScreenControls[parentControlName] as IControlParent;
parentControl.Children.Add(addControl);

Remove control from collection.

C#
// get control to remove
string removeControlName = "Button1";
IControlBase removeControl = Screen.ScreenControls[removeControlName];

// remove from parent
IControlParent parentControl = removeControl.Parent;
parentControl.Children.Remove(removeControl);

See Also