<Grid ShowGridLines="True"> <Grid.RowDefinitions> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition> </Grid.ColumnDefinitions> <Button Grid.Column="0" Grid.Row="0">Top Left</Button> <Button Grid.Column="1" Grid.Row="0">Meddle center</Button> <Button Grid.Column="1" Grid.Row="1">Bottom Meddle</Button> <Button Grid.Column="2" Grid.Row="1">Meddle Right</Button> </Grid>
<Grid ShowGridLines="True" UseLayoutRounding="True"> <Grid.RowDefinitions> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition> </Grid.ColumnDefinitions> <Button Grid.Column="0" Grid.Row="0" >Top Left</Button> <Button Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2">Meddle center</Button> <Button Grid.Column="1" Grid.Row="1">Bottom Meddle</Button> <Button Grid.Column="2" Grid.Row="1">Meddle Right</Button> </Grid>
分割窗口
<Grid UseLayoutRounding="True"> <Grid.RowDefinitions> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition></ColumnDefinition> <ColumnDefinition Width="auto"></ColumnDefinition> <ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition> </Grid.ColumnDefinitions> <Button Grid.Column="0" Grid.Row="0" >Top Left</Button> <Button Grid.Column="2" Grid.Row="0" Grid.ColumnSpan="2">Meddle center</Button> <GridSplitter Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" Width="3" HorizontalAlignment="Center" VerticalAlignment="Stretch" ShowsPreview="False"></GridSplitter> <Button Grid.Column="2" Grid.Row="1">Bottom Meddle</Button> <Button Grid.Column="3" Grid.Row="1" >Meddle Right</Button> </Grid>