Text: String;
The Text property determines the text that will be included into a shape.
Executing the example requires that repository contains a workspace with the WSP identifier containing shape.
Add links to the Andy, Drawing, Metabase system assemblies.
Sub UserProc;
Var
mb: IMetabase;
wsp: IWxWorkspace;
Shape: IWxShape;
Begin
// Get workspace for editing
mb := MetabaseClass.Active;
wsp := mb.ItemById("WSP").Edit As IWxWorkspace;
// Get shape
wsp.BeginUpdate;
Shape := wsp.Shapes.Item(0);
Shape.Text := Shape.Type.ToString;
Shape.Style.TextFontSize := 12;
Shape.Style.TextFontBrushColor := GxColor.FromName("Red");
wsp.EndUpdate;
// Save changes
(wsp As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the shape contains text of the defined color and size. Shape text will be defined using the IWxShape.Type property returning object shape type.
See also: