Control |
public IControlChildren Children { get; }
Iterate through collection.
string parentControlName = "Panel1"; IControlParent parentControl = Screen.ScreenControls[parentControlName] as IControlParent; foreach (IControlBase childControl in parentControl.Children) { // code }
Add control to collection.
// 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.
// get control to remove string removeControlName = "Button1"; IControlBase removeControl = Screen.ScreenControls[removeControlName]; // remove from parent IControlParent parentControl = removeControl.Parent; parentControl.Children.Remove(removeControl);