Xojo.Core.Rect.Contains

From Xojo Documentation

Method

Xojo.Core.Rect.Contains(P As Xojo.Core.Point) As Boolean

Supported for all project types and targets.

Determines if the point is contained within the rect.


Method

Xojo.Core.Rect.Contains(Other As Xojo.Core.Rect) As Boolean

Supported for all project types and targets.

Determines if the other rect is contained with the rect.

Sample Code

Var p As New Xojo.Core.Point(40, 40)
Var rect1 As New Xojo.Core.Rect(10, 10, 100, 100)
If rect1.Contains(p) Then
// Point is contained within the rect
End If
Var rect1 As New Xojo.Core.Rect(10, 10, 100, 100)
Var rect2 As New Xojo.Core.Rect(20, 20, 50, 50)
If rect1.Contains(rect2) Then
// rect2 is contained within rect1
End If