标签:style color io ar strong sp on c line
设置共享尺寸组可以使位于不同Grid的两个列的宽度保持一致。设置共享尺寸组的步骤如下:
示例如下:
<Grid Grid.IsSharedSizeScope="True">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Margin="3" Background="LightYellow" ShowGridLines="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="TextLabel"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Label Margin="5">这是共享尺寸组列!!!!</Label>
<Label Grid.Column="1" Margin="5">More text</Label>
<TextBox Grid.Column="2" Margin="5">A text box</TextBox>
</Grid>
<Grid Grid.Row="1" Margin="3" Background="LightYellow" ShowGridLines="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="TextLabel">
</ColumnDefinition>
<ColumnDefinition>
</ColumnDefinition>
</Grid.ColumnDefinitions>
<Label Margin= "5">共享尺寸组列</Label>
<TextBox Grid.Column=‘1‘ Margin="5">A text box</TextBox>
</Grid>
</Grid>
标签:style color io ar strong sp on c line
原文地址:http://www.cnblogs.com/lyf681888/p/3969581.html