ylbtech-SilverLight-Layout:佈局(1) Border(邊框)對象、Grid(網格)對象 |
1.A, Border(邊框)對象返回頂部 |
<Border BorderBrush="SteelBlue" Margin="25" Background="LightYellow" BorderThickness="8" CornerRadius="15"> <Button Content="Button" Margin="10" /> </Border>
3,Margin,佈局
Background, BorderBrush[邊框顏色], BorderThickness[邊框寬度], CornerRadius[圓角半徑]spa
1.B, Grid(網格)對象返回頂部 |
<Grid ShowGridLines="True" Background="White"> <!--定義表格的行和列 begin--> <Grid.RowDefinitions> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition> </Grid.ColumnDefinitions> <!--定義表格的行和列 end--> <!--A 按鈕位於第一行第一列--> <Button Grid.Row="0" Grid.Column="0" Content="A" Margin="3" FontSize="26"/> <Button Grid.Row="0" Grid.Column="1" Content="B" Margin="3" FontSize="26"/> <Button Grid.Row="1" Grid.Column="1" Content="C" Margin="3" FontSize="26"/> <Button Grid.Row="1" Grid.Column="2" Content="D" Margin="3" FontSize="26"/> </Grid>
3,ShowGridLine[現實網格線], background,3d
Grid.RowDefinitions[定義網格行], Grid.ColumnDefinitions[定義網格列],code
RowDefinition[行定義], ColumnDefinition[列定義],對象
Grid.Row[座標行], Grid.Column[座標列]blog
1.C, Grid(網格)對象之合併行、和並列返回頂部 |
<Grid ShowGridLines="False" Background="White"> <!--定義表格的行和列 begin--> <Grid.RowDefinitions> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition> </Grid.ColumnDefinitions> <!--定義表格的行和列 end--> <Button Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Content="A"/> <Button Grid.Row="0" Grid.Column="1" Content="B"/> <Button Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Content="C"/> </Grid>
3, 同上文B.3get
+, Grid.RowSpan[合併行], Grid.ColumnSpan[和並列]博客
1.D,返回頂部 |
1.E,返回頂部 |
1.F,返回頂部 |
做者:ylbtech 出處:http://ylbtech.cnblogs.com/ 本文版權歸做者和博客園共有,歡迎轉載,但未經做者贊成必須保留此段聲明,且在文章頁面明顯位置給出原文鏈接,不然保留追究法律責任的權利。 |