Equals(Size: IGxSize): Boolean;
Size. The size used for comparison.
The Equals method checks if this size is equal to the size passed by the Size parameter.
The size is determined with integer values.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Size, Size1: IGxSize;
Rect, Rect1: IWxRectangle;
s: String;
Begin
Size:=New GxSize.Create(0,0);
Size1:=New GxSize.Create(0,0);
Rect:=UiWorkspace1.WxWorkspace.CreateRectangle;
Rect1:=UiWorkspace1.WxWorkspace.CreateRectangle;
Size.Width:=Math.RandBetweenI(0,50);
Size1.Width:=Math.RandBetweenI(0,50);
Size.Height:=Math.RandBetweenI(0,50);
Size1.Height:=Math.RandBetweenI(0,50);
Rect.BeginUpdate;
Rect1.BeginUpdate;
Rect.Size:=New GxSizeF.CreateFromSize(Size.ToSizeF);
Rect1.Size:=New GxSizeF.CreateFromSize(Size1.ToSizeF);
Rect.EndUpdate;
Rect1.EndUpdate;
If Size.Equals(Size1) Then
s:="Yes";
Else
s:="No";
End If;
End Sub Button1OnClick;
After executing the example clicking the button creates two rectangles in the workspace, and the "s" variable contains Yes if their sizes are equal.
See also: