Text: String;
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.
Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Drawing;
…
Public Shared Sub Main(Params: StartParams);
Var
mb: Imetabase;
wsp: IWxWorkspace;
Shape: IWxShape;
Color: GxColorClassClass = New GxColorClassClass();
Begin
// Get workspace for editing
mb := Params.Metabase;
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 := Color.FromName("Red");
wsp.EndUpdate();
// Save changes
(wsp As IMetabaseObject).Save();
End Sub;
After executing the example the shape contains text of the defined color and size. The shape text will be defined using the IWxShape.Type property returning object shape type.
See also: