Represents an ordered pair of floating-point numbers that specify a height and width.
A numeric value greater than or equal to 0 that specifies the Width component of the Size structure.
A numeric value greater than or equal to 0 that specifies the Height of the Size structure.
The Size structure has these types of members:
The Size structure has these constructors.
|Size(Double, Double) [C#, VB]||Initializes a new instance of the Size structure and assigns it an initial width and height.|
The Size structure has these fields.
The Size structure has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
|Equals(Object) [C#, VB]||Determines whether the specified object is equal to a Size.|
|Equals(Rect) [C#, VB]||Compares two Size structures for equality.|
|GetHashCode [C#, VB]||Gets a hash code for this object.|
|ToString [C#, VB]||Converts a Size to a String representation.|
The Size structure has these operators.
|Equality||Compares two Size structures for equality.|
|Inequality||Compares two Size structures for inequality.|
The Size structure has these properties.
|Read-only||Gets a value that represents a static empty Size.|
|Read/write||Gets or sets the height of this instance of Size.|
|Read-only||Gets a value that indicates whether this instance of Size is Empty.|
|Read/write||Gets or sets the width of this instance of Size.|
When applied to properties that represent UI information, the width and height values of a Size value represent device-independent pixels.
Object attribute usage is technically permitted by the Windows Runtime XAML parsing rules. However, that usage isn't shown in syntax because it isn't typical. A Size can't be used as a XAML resource.
You can use a space rather than a comma as the delimiter between values.
If you are using a Microsoft .NET language (C# or Microsoft Visual Basic), or Visual C++ component extensions (C++/CX), then Size has non-data members available, and its data members are exposed as read-write properties, not fields.
If you are programming with C++ using the Windows Runtime Template Library (WRL), then only the data member fields exist as members of Size, and you cannot use the utility methods or properties listed in the members table. WRL code can access similar utility methods that are available from the SizeHelper static class.
Minimum supported client
Minimum supported server
|Windows Server 2012|
Minimum supported phone
|Windows Phone 8|