Xojo.Core.Rect.Union

From Xojo Documentation

Method

Xojo.Core.Rect.Union(Other As Xojo.Core.Rect) As Xojo.Core.Rect

Supported for all project types and targets.

Creates a new rect that contains both rects.

Sample Code

Dim rect1 As New Xojo.Core.Rect(10, 10, 100, 100)
Dim rect2 As New Xojo.Core.Rect(5, 5, 10, 10)
Dim rect3 As Xojo.Core.Rect = rect1.Union(rect2)