Version

SetPreferredHeight Method

Sets the preferred height of the element. This height will be used by the panel to determine how much space to allocate to the element.
Syntax
'Declaration
 
Public Shared Sub SetPreferredHeight( _
   ByVal d As DependencyObject, _
   ByVal value As Double _
) 
public static void SetPreferredHeight( 
   DependencyObject d,
   double value
)

Parameters

d
Element to set the preferred height on.
value
Preferred height to set.
Remarks

PreferredHeight property is different from setting the Height property of the element directly. When you set Height property of the element, that will be its final height. It may be desirable instead to specify a preferred height and then let the layout panel adjust the size (make it bigger or smaller) based on the availability of space.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also