tags:

views:

33

answers:

1

I am trying to stretch the wpf tab control content for fit the screen when it resizes even if the tab item is empty. There doesnt seem to be a stretch property?

A: 

I just tried the code below and the rectangle seemed to to stretch correctly. The TabControl also stretched correctly if I removed the Border & Rectangle from the TabItem. Maybe I'm not understanding what you mean by 'empty,' but give this a try.

<Grid>
    <TabControl HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <TabItem Header="Item 1" Name="tabItem1">
            <Border Margin="5" BorderBrush="Red" BorderThickness="3">
                <Rectangle Fill="Pink" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
            </Border>
        </TabItem>
    </TabControl>
</Grid>
JSprang