<Grid x:Name="PS_Container" Visibility="Visible" Height="500">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="container_Grid_Width1" Width="1*"/>
<ColumnDefinition x:Name="container_Grid_Width2" Width="4*"/>
<ColumnDefinition x:Name="container_Grid_Width3" Width="6*"/>
</Grid.ColumnDefinitions>
</Grid>
在cs檔中,指定寬度的方式(以下分別指定Colunm1、Colunm2、Colunm3):
GridLength gl = new GridLength(82);
container_Grid_Width1.Width = gl;
gl = new GridLength(328);
container_Grid_Width2.Width = gl;
gl = new GridLength(Application.Current.Host.Content.ActualWidth - 410);
container_Grid_Width3.Width = gl;
以上將欄位寬度分成82、328、(410-328-82)等大小,其中
沒有留言:
張貼留言