Represents a geometric shape with four edges and four right angles. You can set and return its position and dimensions with its Top, Left, Bottom and Right properties.


The following tables list the members exposed by Rectangle.

Public Constructors

  Name Description
Static Public method Rectangle Overloaded.  
Top

Public Properties

  Name Description
Public property Bottom Gets or sets the Y coordinate of the lower-right corner of the rectangle.
Public property Center Returns the center point of the rectangle.
Public property Height Returns the vertical dimension of the rectangle.
Public property Left Gets or sets the X coordinate of the upper-left corner of the rectangle.
Public property Right Gets or sets the X coordinate of the lower-right corner of the rectangle.
Public property Top Gets or sets the Y coordinate of the upper-left corner of the rectangle.
Public property Width Returns the horizontal dimension of the rectangle.
Top

Public Methods

  Name Description
Public method Deflate Deflates the rectangle by moving its sides toward its center. To do this, Deflate adds units to the left and bottom and subtracts units from the right and top.
Public method Inflate Inflates the rectangle by moving its sides away from its center. To do this, Inflate subtracts units from the left and bottom and adds units to the right and top.
Public method Intersects Returns a value that indicates whether a rectangle intersects another rectangle.
Public method IsPointIn Returns a value that indicates whether a Point falls within the Rectangle.
Public method Offset Moves the rectangle object by the specified offset horizontally and vertically.
Public method Union Changes the Rectangle object to a Rectangle object that represents the geometric union of itself and a Point object.
Public method UnionRectangle Changes the Rectangle to a Rectangle that represents the geometric union of itself and the specified Rectangle object.
Top

Explicit Interface Implementations

  Name Description
Static Private method Rectangle Overloaded.  
Top

See Also