Equals(Size: IGxSizeF): 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 real values.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
SizeF, Size1F: IGxSizeF;
Rect, Rect1: IWxRectangle;
b: Boolean;
s: String;
Begin
SizeF:=New GxSizeF.Create(0,0);
Size1F:=New GxSizeF.Create(0,0);
Rect:=UiWorkspace1.WxWorkspace.CreateRectangle;
Rect1:=UiWorkspace1.WxWorkspace.CreateRectangle;
SizeF.Width:=Math.RandBetween(0.25,50.5);
Size1F.Width:=Math.RandBetween(0.25,50.5);
SizeF.Height:=Math.RandBetween(0.25,50.5);
Size1F.Height:=Math.RandBetween(0.25,50.5);
Rect.BeginUpdate;
Rect1.BeginUpdate;
Rect.Size:=New GxSizeF.CreateFromSize(SizeF);
Rect1.Size:=New GxSizeF.CreateFromSize(Size1F);
Rect.EndUpdate;
Rect1.EndUpdate;
If SizeF.Equals(Size1F) 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: