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: 25.6.0.25344+3070493948bf7d32a86bd3e9a8bcf4cc9a5b1929
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