Siverlight grid.row colum 布局

代码附上:(涉及到行列长宽,合并,表格线展示等基础属性设计,及一些常用控件页面布局,字体颜色渐变,显示方向等属性的定义)

<Grid x:Name="LayoutRoot" Background="White"  >
        <Grid Width="400" Height="300" ShowGridLines="False"  Background="Gold">
            <Grid.RowDefinitions>
            <RowDefinition></RowDefinition>
            <RowDefinition  ></RowDefinition>
            <RowDefinition Height="*"  ></RowDefinition>
            <RowDefinition   Height="0.2*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="2*"></ColumnDefinition>
            <ColumnDefinition Width="2*"></ColumnDefinition>
                <ColumnDefinition Width="2*"></ColumnDefinition>
           
        </Grid.ColumnDefinitions>
        
        <TextBlock Grid.Row="0" Grid.Column="0" Text="第一行第一列" Foreground="Red" ></TextBlock>
        <TextBlock Grid.Row="0" Grid.Column="1" Text="第一行第二列"></TextBlock>
        <TextBlock Grid.Row="0" Grid.Column="2" Text="第一行第三列"></TextBlock>
        
        <TextBlock Grid.Row="1" Grid.Column="0" Text="第二行第一列"></TextBlock>
        <TextBlock Grid.Row="1" Grid.Column="1" Text="第二行第二列"></TextBlock>

            <TextBlock Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Center"  Margin="0,20,0,26" Text="第三行跨2列 第三行跨2列第三行跨2列第三行跨2列">
                <TextBlock.Foreground><LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FF5AF23E" Offset="1" />
                </LinearGradientBrush>
                </TextBlock.Foreground>
            </TextBlock>
            <TextBlock Grid.Row="1" Grid.RowSpan="2" Grid.Column="2"  FontSize="9"  Text="第三列 第三行并第二行" 
                       FlowDirection="RightToLeft" Foreground="#FF2836DE">
                
            </TextBlock>
        
            <Button  Grid.Row="3" Grid.ColumnSpan="3" Background="Purple"  Content="第4行跨4列"></Button>
        </Grid>
    </Grid>

上效果图(有网格线、无网格线)


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值