Rectangle Class

Description

Specifies a rectangle on the screen.

Inheritance Hierarchy

Rectangle does not derive from any class, and no classes derive from it.

Syntax

C#
public class Rectangle
VB
Public Class Rectangle

Properties

Name Description
X Gets the x coordinate of the rectangle.
Y Gets the y coordinate of the rectangle.
Width Gets the width of the rectangle.
Height Gets the height of the rectangle.
Center Gets the center of the rectangle.
IsEmpty Determines whether the rectangle is empty.

Methods

Name Description
Contains(Rectangle) Determines whether the current Rectangle contains the specified Rectangle. Boolean
Contains(Point) Determines whether the current Rectangle contains the specified Point. Boolean
Contains(X,Y) Determines whether the current Rectangle contains the specified coordinates. Boolean