IWxContainer.ChildShapes

Syntax

ChildShapes: IWxShape;

ChildShapes: Prognoz.Platform.Interop.Andy.IWxShape;

Description

The ChildShapes property returns a collection of shapes that are direct child objects.

Only an object group or a workspace can have child objects.

Example

Executing the example requires that repository contains a workspace with the WSP identifier containing group of objects with the Shape3 identifier.

Add links to the Andy, Drawing, Metabase system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    ws: IWxWorkspace;
    Group: IWxGroup;
    Shapes: IWxShapes;
    Shape: IWxShape;
Begin
    
// Get workspace for editing
    mb := MetabaseClass.Active;
    ws := mb.ItemById(
"WSP").Edit As IWxWorkspace;
    Shapes := ws.Shapes;
    ws.BeginUpdate;
    Group := ws.Shapes.FindById(
"Shape3"As IWxGroup;
    Shape := Group.ChildShapes.Item(
0);
    Shape.Style.BackgroundBrushForeColor := GxColor.FromName(
"Red");
    ws.EndUpdate;
    (ws 
As IMetabaseObject).Save;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Drawing;

 
Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    ws: IWxWorkspace;
    Group: IWxGroup;
    Shapes: IWxShapes;
    Shape: IWxShape;
    GxColor: GxColorClassClass = New  GxColorClassClass();
Begin
    
// Get workspace for editing
    mb := Params.Metabase;
    ws := mb.ItemById[
"WSP"].Edit() As IWxWorkspace;
    Shapes := ws.Shapes;
    ws.BeginUpdate();
    Group := ws.Shapes.FindById(
"Shape
3"As IWxGroup;
    Shape := Group.ChildShapes.Item[
0];
    Shape.Style.BackgroundBrushForeColor := GxColor.FromName(
"Red");
    ws.EndUpdate();
    (ws 
As IMetabaseObject).Save();
End Sub;

After executing the example the background of one object belonging to a group is changed.

See also:

IWxContainer