RectangleF.Contains Method

Definition

Determines if the specified point is contained within this RectangleF structure.

Overloads

Contains(PointF)

Determines if the specified point is contained within this RectangleF structure.

Contains(RectangleF)

Determines if the rectangular region represented by rect is entirely contained within this RectangleF structure.

Contains(Single, Single)

Determines if the specified point is contained within this RectangleF structure.

Contains(PointF)

Source:
RectangleF.cs
Source:
RectangleF.cs
Source:
RectangleF.cs

Determines if the specified point is contained within this RectangleF structure.

C#
public readonly bool Contains (System.Drawing.PointF pt);
C#
public bool Contains (System.Drawing.PointF pt);

Parameters

pt
PointF

The PointF to test.

Returns

true if the point represented by the pt parameter is contained within this RectangleF structure; otherwise, false.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

Contains(RectangleF)

Source:
RectangleF.cs
Source:
RectangleF.cs
Source:
RectangleF.cs

Determines if the rectangular region represented by rect is entirely contained within this RectangleF structure.

C#
public readonly bool Contains (System.Drawing.RectangleF rect);
C#
public bool Contains (System.Drawing.RectangleF rect);

Parameters

rect
RectangleF

The RectangleF to test.

Returns

true if the rectangular region represented by rect is entirely contained within the rectangular region represented by this RectangleF; otherwise, false.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

Contains(Single, Single)

Source:
RectangleF.cs
Source:
RectangleF.cs
Source:
RectangleF.cs

Determines if the specified point is contained within this RectangleF structure.

C#
public readonly bool Contains (float x, float y);
C#
public bool Contains (float x, float y);

Parameters

x
Single

The x-coordinate of the point to test.

y
Single

The y-coordinate of the point to test.

Returns

true if the point defined by x and y is contained within this RectangleF structure; otherwise, false.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1