开发者

TabControl will not stretch

I am failing at getting a tab control inside a tab control to fill its container. I think it is some simple property I am overlooking or have not found yet. In the xaml below I would like the TabControl 'sub' to completely fill the canvas 'canvas2'.

Thank You, Venkat

<Border BorderBrush="AliceBlue" BorderThickness="1,1,1,1">
    <TabControl name="Main">
        <TabItem Header="Test1">
            <DockPanel LastChildFill="True">
                <Border BorderBrush="Green" BorderThickness="1,1,1,1">
                    <Canvas Width="350" Height="200" DockPanel.Dock="Left">

                    </Canvas>
                </Border>
                <Border BorderBrush="Red" BorderThickness="1,1,1,1">
                    <Canvas name="canvas2">
                        <Border BorderBrush="Yellow" BorderThickness="1,1,1,1">                                
                                <TabControl Height="600" HorizontalAlignment="Stretch"  name="sub">
                                    <TabItem Header="Rights Test 1" HorizontalAlignment="Stretch">
                                        <Canvas></Canvas>
                                    </TabItem>
                                    <TabItem Header="Rights Test 2">
                                        <Canvas></Canvas>
                                    </TabItem>
                                </TabControl>                                
                        </Borde开发者_运维知识库r>
                    </Canvas>
                </Border>
            </DockPanel>
        </TabItem>
    </TabControl>
</Border>


Canvas's do not stretch to fill their given space. So get rid of canvas2.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜