Compartilhar via


Rectangle Structure

Stores the location and size of a rectangular region.

Namespace:  Microsoft.VisualStudio.TestTools.UITest.Input
Assembly:  Microsoft.VisualStudio.TestTools.UITest.Extension (in Microsoft.VisualStudio.TestTools.UITest.Extension.dll)

Syntax

'Declaration
Public Structure Rectangle
public struct Rectangle
public value class Rectangle
[<Sealed>]
type Rectangle =  struct end
JScript supports the use of structures, but not the declaration of new ones.

The Rectangle type exposes the following members.

Constructors

  Name Description
Public method Rectangle Initializes a new instance of the Rectangle Class with specified location and size.

Top

Properties

  Name Description
Public property Bottom Gets the y-coordinate of the lower-right corner of the rectangular region defined by this instance.
Public property Height Gets or sets the height defined by this rectangle instance.
Public property IsEmpty Gets whether this System.Drawing.Rectangle has a System.Drawing.Rectangle.Width or a System.Drawing.Rectangle.Height of 0.
Public property Left Gets x-coordinate of the upper-left corner of the rectangular region defined by this instance.
Public property Location Gets or sets the coordinates of the upper-left corner of the rectangular region represented by this rectangle instance.
Public property Right Gets the x-coordinate of the lower-right corner of the rectangular region defined by this instance.
Public property Top Gets y-coordinate of the upper-left corner of the rectangular region defined by this instance.
Public property Width Gets or sets the width defined by this rectangle instance.
Public property X Gets or sets the x-coordinate of the upper-left corner of the rectangular region defined by this rectangle instance.
Public property Y Gets or sets the y-coordinate of the upper-left corner of the rectangular region defined by this rectangle instance.

Top

Methods

  Name Description
Public method Contains(Point) Determines if the specfied point is contained within the rectangular region defined by this instance.
Public method Contains(Rectangle) Determines if the rectangular region is entirely contained within the rectangular region represented by this instance.
Public method Contains(Int32, Int32) Determines if the specfied point is contained within the rectangular region defined by this instance.
Public method Equals Checks if the object is equal to this instance of rectangle. (Overrides ValueType.Equals(Object).)
Public method GetHashCode Gets the hash code for the object. (Overrides ValueType.GetHashCode.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method Inflate Inflates this System.Drawing.Rectangle by the specified amount.
Public method Intersect(Rectangle) Creates a Rectangle that represents the intersection between this Rectangle and rect.
Public methodStatic member Intersect(Rectangle, Rectangle) Creates a rectangle that represents the intersetion between a and b. If there is no intersection, null is returned.
Public method ToString Converts the attributes of this instance to a human readable string. (Overrides ValueType.ToString.)

Top

Operators

  Name Description
Public operatorStatic member Equality Tests whether two instance of objects have equal location and size.
Public operatorStatic member Inequality Tests whether two instances of objects differ in location or size.

Top

Fields

  Name Description
Public fieldStatic member Empty Stores the location and size of a rectangular region.&gt;

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.TestTools.UITest.Input Namespace