IWxShape.Style

Syntax

Style: IWxStyle;

Style: Prognoz.Platform.Interop.Andy.IWxStyle;

Description

The Style property determines shape formatting parameters.

Example

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;
    Style: IWxStyle;
Begin
    // Get workspace for editing
    mb := MetabaseClass.Active;
    wsp := mb.ItemById("WSP").Edit As IWxWorkspace;
    wsp.BeginUpdate;
    Shape := wsp.Shapes.Item(0);
    Shape.Text := "Text";
    Style := Shape.Style;
    Style.TextFontSize := 12;
    Style.TextFontBrushColor := GxColor.FromName("Red");
    Style.TextAlignmentHorizontal := GxAlignment.Far;
    wsp.EndUpdate;
    (wsp 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;
    wsp: IWxWorkspace;
    Shape: IWxShape;
    Style: IWxStyle;
    Color: GxColorClassClass = 
New GxColorClassClass();
Begin
    
// Get workspace for editing
    mb := Params.Metabase;
    wsp := mb.ItemById[
"WSP"].Edit() As IWxWorkspace;
    wsp.BeginUpdate();
    Shape := wsp.Shapes.Item[
0];
    Shape.Text := 
"Text";
    Style := Shape.Style;
    Style.TextFontSize := 
12;
    Style.TextFontBrushColor := Color.FromName(
"Red");
    Style.TextAlignmentHorizontal := GxAlignment.walFar;
    wsp.EndUpdate();
    (wsp 
As IMetabaseObject).Save();
End Sub;

After executing the example an object contains text of the defined color and size, which is aligned right.

See also:

IWxShape