Size Structure

Implements a structure that is used to describe the Size of an object.

Namespace: System.Windows
Assembly: WindowsBase (in windowsbase.dll)
XML Namespace:

public struct Size : IFormattable
/** @attribute SerializableAttribute() */ 
/** @attribute TypeConverterAttribute(System.Windows.SizeConverter) */ 
public final class Size extends ValueType implements IFormattable
<object property="width,height"/>
 width  A value greater than or equal to 0 that specifies the Width of the Size structure.   height  A value greater than or equal to 0 that specifies the Height of the Size structure. 

Size is particularly useful because it describes both the Height and Width of an object. Size is used extensively by the layout system to arrange and measure elements.

The following example demonstrates how to use a Size structure in code.

protected override Size MeasureOverride(Size availableSize)
    Size childSize = availableSize;
    foreach (UIElement child in InternalChildren)
    return availableSize;

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.

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 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions