2014-05-21 20 views

cevap

17

:

  • en sol: Grid.Column =

    <Grid> 
        <Grid.RowDefinitions> 
         <RowDefinition Height="*" /> 
         <RowDefinition Height="2*" /> 
         <RowDefinition Height="*" /> 
        </Grid.RowDefinitions> 
        <Grid.ColumnDefinitions> 
         <ColumnDefinition Width="*" /> 
         <ColumnDefinition Width="3*" /> 
        </Grid.ColumnDefinitions> 
    </Grid> 
    

    5 hücreleri gibi olur "0", Grid.Row = "0"

  • sağ üst: Grid.Column = "1", Grid.Row = "0"
  • Merkezi: Grid.Column = "0", Grid.Row = "1", Grid.ColumnSpan = "2"
  • Alt sol: Grid.Column = "0", Grid.Row = "2 "
  • sağ alt: Grid.Column =" 1" , Grid.Row = "2"
10

Şimdi, bu çok basit bir vaziyettedir. İki sütun ve iki sütunu kapsayan ikinci sıra içerikli üç sıra ... bundan daha basit almaz ...

<Grid Width="640" Height="480"> 
    <Grid.ColumnDefinitions> 
     <ColumnDefinition Width="3*"/> 
     <ColumnDefinition Width="7*"/> 
    </Grid.ColumnDefinitions> 
    <Grid.RowDefinitions> 
     <RowDefinition Height="25*"/> 
     <RowDefinition Height="50*"/> 
     <RowDefinition Height="25*"/> 
    </Grid.RowDefinitions> 
    <Border Grid.Column="0" Grid.Row="0" BorderBrush="Red" Margin="1" BorderThickness="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/> 
    <Border Grid.Column="1" Grid.Row="0" BorderBrush="Green" Margin="1" BorderThickness="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/> 
    <Border Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" Margin="1" BorderThickness="2" BorderBrush="Blue" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/> 
    <Border Grid.Column="0" Grid.Row="2" BorderBrush="Red" Margin="1" BorderThickness="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/> 
    <Border Grid.Column="1" Grid.Row="2" BorderBrush="Green" Margin="1" BorderThickness="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/> 
    </Grid> 

enter image description here