IWxWorkspace.CreateRectangle

Syntax

CreateRectangle: IWxRectangle;

Description

The CreateRectangle method creates a rectangle.

Example

Executing the example requires a form with the Button and UiWorkspaceObject components with the Button1 and UiWorkspaceObject1 identifiers, respectively. A corresponding repository object must be connected to UiWorkspaceObject.

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

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    ws: IWxWorkspace;
    Rec: IWxRectangle;
Begin
    ws := UiWorkspaceObject1.Instance 
As IWxWorkspace;
    Rec := ws.CreateRectangle;
    Rec.Id := 
"Rectangle1";
    Rec.PinPosition := 
New GxPointF.Create(12.3,-2);
    Rec.Text := 
"Rectangle";
End Sub Button1OnClick;

After executing the example a rectangle is created on the UiWorkspaceObject1 component on clicking the Button1 component.

See also:

IWxWorkspace