Rectangle.Contains

Contains(int, int)

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

public bool Contains(int x, int y)
ParameterTypeDescription
xInt32The x-coordinate of the point to test.
yInt32The y-coordinate of the point to test.

Return Value

This method returns true if the point defined by x and y is contained within this Rectangle structure; otherwise false.

See Also


Contains(Point)

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

public bool Contains(Point pt)
ParameterTypeDescription
ptPointThe Point to test.

Return Value

This method returns true if the point represented by pt is contained within this Rectangle structure; otherwise false.

See Also


Contains(Rectangle)

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

public bool Contains(Rectangle rect)
ParameterTypeDescription
rectRectangleThe Rectangle to test.

Return Value

This method returns true if the rectangle represented by rect is entirely contained within the rectangular region represented by this Rectangle; otherwise false.

See Also