Id: String;
The Id property determines formatting style identifier.
By default, styles will be assigned with the Style N identifiers, where N is a style number.
Executing the example requires that the repository contains a workspace with the IWSTYLE identifier that contains several shapes.
Add links to the Andy, Metabase, Drawing system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
Wsp: IWxWorkspace;
Style: IWxStyle;
Begin
// Get workspace for editing
Mb := MetabaseClass.Active;
Wsp := Mb.ItemById("IWSTYLE").Edit As IWxWorkspace;
Style := Wsp.CreateStyle;
Style.Id := "New_Style";
Style.IsPrivate := False;
Style.BackgroundBrushForeColor := GxColor.FromName("Red");
Style.ShadowBrushForeColor := GxColor.FromName("Yellow");
Style.TextAlignmentHorizontal := GxAlignment.Far;
(Wsp As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the added style is displayed in the styles collection.
See also: