Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
Rectangle Structure
Collapse All/Expand All Collapse All
.NET Framework Class Library
Rectangle Structure

Stores a set of four integers that represent the location and size of a rectangle. For more advanced region functions, use a Region object.

Namespace:  System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)
Visual Basic (Declaration)
<SerializableAttribute> _
<ComVisibleAttribute(True)> _
<TypeConverterAttribute(GetType(RectangleConverter))> _
Public Structure Rectangle
Visual Basic (Usage)
Dim instance As Rectangle
C#
[SerializableAttribute]
[ComVisibleAttribute(true)]
[TypeConverterAttribute(typeof(RectangleConverter))]
public struct Rectangle
Visual C++
[SerializableAttribute]
[ComVisibleAttribute(true)]
[TypeConverterAttribute(typeof(RectangleConverter))]
public value class Rectangle
JScript
JScript supports the use of structures, but not the declaration of new ones.

A rectangle is defined by its width, height, and upper-left corner.

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

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0

XNA Framework

Supported in: 3.0, 2.0, 1.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Note on Right and Bottom properties      TENware   |   Edit   |   Show History
These properties are incorrectly calculated and return values that are 1 more than actual.
e.g.
Dim rect As New Rectangle(0, 0, 100, 10)
rect.Right = 100 and rect.bottom = 10
As the location (point) is 0, 0 the rightmost value should be 99 and the bottommost value should be 9.
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker