ColumnDefinition.Width 属性

定义

获取 ColumnDefinition 元素的计算所得宽度,或设置由 ColumnDefinition 定义的列的 GridLength 值。Gets the calculated width of a ColumnDefinition element, or sets the GridLength value of a column that is defined by the ColumnDefinition.

public:
 property System::Windows::GridLength Width { System::Windows::GridLength get(); void set(System::Windows::GridLength value); };
public System.Windows.GridLength Width { get; set; }
member this.Width : System.Windows.GridLength with get, set
Public Property Width As GridLength

属性值

GridLength

表示列宽的 GridLengthThe GridLength that represents the width of the Column. 默认值为 1.0。The default value is 1.0.

注解

默认 GridUnitTypeStarThe default GridUnitType is Star.

添加或删除行或列时,在调用 Measure 之前,所有 ColumnDefinition 元素的 ActualWidth 和所有 RowDefinition 元素的 ActualHeight 都将变为零。When you add or remove rows or columns, the ActualWidth for all ColumnDefinition elements and the ActualHeight of all RowDefinition elements becomes zero until Measure is called.

依赖项属性信息Dependency Property Information

标识符字段Identifier field WidthProperty
元数据属性设置为 trueMetadata properties set to true None

适用于