HwndHost.MeasureOverride(Size) Method

Definition

Returns the size of the window represented by the HwndHost object, as requested by layout engine operations.

C#
[System.Security.SecurityCritical]
[System.Security.SecurityTreatAsSafe]
protected override System.Windows.Size MeasureOverride(System.Windows.Size constraint);
C#
protected override System.Windows.Size MeasureOverride(System.Windows.Size constraint);

Parameters

constraint
Size

The size of the HwndHost object.

Returns

The size of the HwndHost object.

Attributes

Remarks

Important

This type or member is not available in the Internet security zone.

Notes to Inheritors

In Win32, a window is expected to be the size requested by layout at the time the window is created. Derived classes should override this method only if they have additional information regarding required window size.

The specific implementation here is already an override of the FrameworkElement virtual member, which bases size constraints on the window handle and treats a zero value in one or more dimensions as a non-constraint. The WindowsFormsHost class also overrides a MeasureOverride(Size) implementation that will result in a clip of the form if it is too large.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9