共用方式為


RowDefinition.Height Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets the calculated height of a RowDefinition element, or sets the GridLength value of a row that is defined by the RowDefinition.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Public Property Height As GridLength
public GridLength Height { get; set; }
<RowDefinition Height="doubleValue"/>
- or -
<RowDefinition Height="starSizing"/>
-or-
<RowDefinition Height="Auto"/>

XAML Values

  • doubleValue
    The row's height, expressed as a floating-point value for a pixel count. Typically this is specified as an integer, although interpolation of floating-point values is supported by grid layout.

  • starSizing
    A convention by which you can size rows or columns to take the remaining available space in a Grid. A star sizing always includes the asterisk character (*), and optionally precedes the asterisk with an integer value that specifies a weighted factor versus other possible star sizings (for example, 3*). For more information about star sizing, see Grid.

  • Auto
    The row's height, described by the literal Auto. For more information about Auto sizing, see Grid.

Property Value

Type: System.Windows.GridLength
The GridLength that represents the height of the row. The default value is 1.0.

Remarks

Dependency property identifier field: HeightProperty

The default GridUnitType is Star.

When you use these values in the same code example, the MinHeight value takes precedence over the MaxHeight value, which in turn takes precedence over the Height value.

When you add or remove rows or columns, the ActualWidth for all ColumnDefinition elements and the ActualHeight of all RowDefinition elements become zero until Measure is called.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.