我的DockPanel内的控件不符合预期的页面宽度

时间:2016-09-27 08:40:08

标签: c# xaml dockpanel

我无法让我的GroupBox占用尽可能多的空间

<DockPanel LastChildFill="True" >
            <GroupBox Header="MyTitle"  >
            </GroupBox>
 </DockPanel>

我以为

<DockPanel LastChildFill="True" >

会做到这一点,但事实并非如此。

我也尝试过这种方式没有更好的结果:

<DockPanel LastChildFill="True" >
                <GroupBox Header="MyTitle"  >
                        <DockPanel LastChildFill="True" >
                        </DockPanel>
                </GroupBox>
     </DockPanel>

具体地说,在两次尝试中,groupbox width =“MyTitle”的宽度。 我希望它适合页面。

编辑: 不确定它是否有所不同,此块包含在具有可变宽度的网格中:

<Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="170"/>
                <ColumnDefinition Width="570"/>
                <ColumnDefinition/>  <---------------- the dockpanel is in this column although I dropped the tags into this post            
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="0.58*"/>
                <RowDefinition Height="0.42*"/>
            </Grid.RowDefinitions>  

0 个答案:

没有答案
相关问题