Size Structure
.NET Framework 4.5
Implements a structure that is used to describe the Size of an object.
Namespace: System.Windows
Assembly: WindowsBase (in WindowsBase.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
The Size type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Compares an object to an instance of Size for equality. (Overrides ValueType::Equals(Object).) |
![]() | Equals(Size) | Compares a value to an instance of Size for equality. |
![]() ![]() | Equals(Size, Size) | Compares two instances of Size for equality. |
![]() | GetHashCode | Gets the hash code for this instance of Size. (Overrides ValueType::GetHashCode().) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() ![]() | Parse | Returns an instance of Size from a converted String. |
![]() | ToString() | Returns a String that represents this Size object. (Overrides ValueType::ToString().) |
![]() | ToString(IFormatProvider) | Returns a String that represents this instance of Size. |
| Name | Description | |
|---|---|---|
![]() ![]() | Equality | Compares two instances of Size for equality. |
![]() ![]() | Explicit(Size to Vector) | Explicitly converts an instance of Size to an instance of Vector. |
![]() ![]() | Explicit(Size to Point) | Explicitly converts an instance of Size to an instance of Point. |
![]() ![]() | Inequality | Compares two instances of Size for inequality. |
| Name | Description | |
|---|---|---|
![]() ![]() | IFormattable::ToString | This type or member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. |
The following example demonstrates how to use a Size structure in code.
virtual Size MeasureOverride(Size availableSize) override
{
Size^ panelDesiredSize = gcnew Size();
// In our example, we just have one child.
// Report that our panel requires just the size of its only child.
for each (UIElement^ child in InternalChildren)
{
child->Measure(availableSize);
panelDesiredSize = child->DesiredSize;
}
return *panelDesiredSize ;
}
More Code
| How to: Create an Elliptical Arc | This example shows how to draw an elliptical arc. To create an elliptical arc, use the PathGeometry, PathFigure, and ArcSegment classes. |
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
.gif?cs-save-lang=1&cs-lang=cpp)
.gif?cs-save-lang=1&cs-lang=cpp)
.gif?cs-save-lang=1&cs-lang=cpp)
.gif?cs-save-lang=1&cs-lang=cpp)
.gif?cs-save-lang=1&cs-lang=cpp)
.gif?cs-save-lang=1&cs-lang=cpp)