I am trying to get 2 buttons to be beside each other and evenly take up the entire row underneath the "main area".
I seem to be missing something
Thanks!
<Grid Background="Transparent" Margin="0" Opacity=".8">
<Border Name="MaskBorder" Grid.RowSpan="3">
<Border Name="MainBorder" Background="Aqua">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30"/>
<ColumnDefinition Width="811*"/>
开发者_如何学编程 <ColumnDefinition Width="30"/>
</Grid.ColumnDefinitions>
<!--Body-->
<Grid Grid.ColumnSpan="4">
<Border Name="BodyBackground" Background="White" />
</Grid>
<!-- Main Area for Content -->
<Grid Name="ContentGrid" Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="55" />
<RowDefinition Height="811*" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<DockPanel LastChildFill="True" Grid.Row="1">
<Grid DockPanel.Dock="Bottom">
<Button Height="55"></Button>
<Button Height="55"></Button>
</Grid>
<Border Background="Black" />
</DockPanel>
</Grid>
</Grid>
</Border>
</Border>
</Grid>
You have the buttons on the same grid cell. Try:
<Grid DockPanel.Dock="Bottom">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Height="55"></Button>
<Button Grid.Column="1" Height="55"></Button>
</Grid>
you can use StackPanel Instead of DockPanle like this:
<StackPanel Orientation="Vertical">
<Button Height="55"/>
<Button Height="55"/>
</StackPanel>
精彩评论