zoukankan      html  css  js  c++  java
  • WPF用Grid分隔窗体

    网上找的一段非常好的WPF的代码

    Grid Name="gridMain">
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="30*" />
    <ColumnDefinition Width="70*" />
    </Grid.ColumnDefinitions>
    <Label Background="LightBlue" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"
    Grid.Row="0" Grid.Column="0">
    Column1
    </Label>
    <GridSplitter Width="5" VerticalAlignment="Stretch" HorizontalAlignment="Right" />
    <Label Background="LightGreen" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"
    Grid.Row="0" Grid.Column="1">
    Column2
    </Label>
    <Grid Name="gridRightColumn" Grid.Row="0" Grid.Column="1">
    <Grid.RowDefinitions>
    <RowDefinition />
    <RowDefinition />
    </Grid.RowDefinitions>
    <Label Grid.Row="0" Grid.Column="0" Width="60" Height="60" HorizontalAlignment="Center"
    VerticalAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
    Background="HotPink">
    Row1
    </Label>
    <Grid Grid.Row="0" Grid.Column="0">
    <Grid.RowDefinitions>
    <RowDefinition />
    <RowDefinition />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
    <ColumnDefinition />
    <ColumnDefinition />
    </Grid.ColumnDefinitions>
    <TextBlock Grid.Row="0" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center">Cell11</TextBlock>
    <TextBlock Grid.Row="0" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">Cell12</TextBlock>
    <TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center">Cell21</TextBlock>
    <TextBlock Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">Cell22</TextBlock>
    <GridSplitter Width="5" Grid.RowSpan="2" VerticalAlignment="Stretch" HorizontalAlignment="Right" />
    <GridSplitter Height="5" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" />
    </Grid>
    <GridSplitter Height="5" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" />
    <Label Grid.Row="1" Grid.Column="0" Width="60" Height="60" HorizontalAlignment="Center"
    VerticalAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
    Background="HotPink">
    Row2
    </Label>
    </Grid>

    原文地址:http://www.cnblogs.com/Ray898/articles/5051584.html

  • 相关阅读:
    深入解析Hibernate核心接口
    Hibernate基本原理
    深入hibernate的三种状态
    Hibernate commit() 和flush() 的区别
    Hibernate中的merge使用详情解说
    Record is locked by another user
    Vue路由router-link的使用
    Vue-router的基本使用
    Vue把父组件的方法传递给子组件调用(评论列表例子)
    Vue中子组件调用父组件的方法
  • 原文地址:https://www.cnblogs.com/Ray898/p/5051950.html
Copyright © 2011-2022 走看看