SilverLight:布局(1) Border(邊框)對象、Grid(網格)對象


ylbtech-SilverLight-Layout:布局(1) Border(邊框)對象、Grid(網格)對象
  • A, Border(邊框)對象
  • B, Grid(網格)對象
  • C, Grid(網格)對象之合並行、和並列
1.A, Border(邊框)對象返回頂部
1,
2,
<Border BorderBrush="SteelBlue" Margin="25" Background="LightYellow" BorderThickness="8" CornerRadius="15">
            <Button Content="Button" Margin="10" />
</Border>

3,Margin,

Background, BorderBrush[邊框顏色], BorderThickness[邊框寬度], CornerRadius[圓角半徑]

4,
1.B, Grid(網格)對象返回頂部
1,
2,
<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,

Grid.RowDefinitions[定義網格行], Grid.ColumnDefinitions[定義網格列],

RowDefinition[行定義], ColumnDefinition[列定義],

Grid.Row[坐標行], Grid.Column[坐標列]

4,
1.C, Grid(網格)對象之合並行、和並列返回頂部
1,
2,
<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.3

+, Grid.RowSpan[合並行], Grid.ColumnSpan[和並列]

4,
1.D,返回頂部
1,
2,
3,
4,
1.E,返回頂部
1,
2,
3,
4,
1.F,返回頂部
 
warn 作者:ylbtech
出處:http://ylbtech.cnblogs.com/
本文版權歸作者和博客園共有,歡迎轉載,但未經作者同意必須保留此段聲明,且在文章頁面明顯位置給出原文連接,否則保留追究法律責任的權利。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM