Size Structure
Implements a structure that is used to describe the Size of an object.
Assembly: WindowsBase (in WindowsBase.dll)
| Name | Description | |
|---|---|---|
![]() | Size(Double, Double) | Initializes a new instance of the Size structure and assigns it an initial width and height. |
| 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() | |
![]() ![]() | Parse(String^) | 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(Size, Size) | Compares two instances of Size for equality. |
![]() ![]() | Explicit(Size to Point) | Explicitly converts an instance of Size to an instance of Point. |
![]() ![]() | Explicit(Size to Vector) | Explicitly converts an instance of Size to an instance of Vector. |
![]() ![]() | Inequality(Size, Size) | Compares two instances of Size for inequality. |
| Name | Description | |
|---|---|---|
![]() ![]() | IFormattable::ToString(String^, IFormatProvider^) | 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 ;
}
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.





