Andrey Bushman
Andrey Bushman

Reputation: 12516

place headers for TabControl at right and vertical it's text

Sorry for my English.

I need to place headers for TabControl at right and vertical it's text. I wrote it XAML code:

<TabControl Grid.ColumnSpan="2" Grid.Row="1" HorizontalAlignment="Stretch" 
            Name="tabControl1" VerticalAlignment="Stretch"  Grid.RowSpan="2" 
            TabStripPlacement="Right">
    <TabItem Name="tabItem1">
        <TabItem.Header>
            <TextBlock Margin="3">
                <TextBlock.RenderTransform>
                    <RotateTransform CenterX="0" CenterY="0" Angle="90" />
                </TextBlock.RenderTransform>
                <TextBlock.Text>
                    123 444 555 666
                </TextBlock.Text>
            </TextBlock>
        </TabItem.Header>
    </TabItem>
    <TabItem Name="tabItem2">
        <TabItem.Header>
            <TextBlock Margin="3">
                <TextBlock.RenderTransform>
                    <RotateTransform CenterX="0" CenterY="0" Angle="90" />
                </TextBlock.RenderTransform>
                <TextBlock.Text>
                    ABCDEF
                </TextBlock.Text>
            </TextBlock>
        </TabItem.Header>
    </TabItem>
</TabControl>

I get it result:

enter image description here

The result turned out bad. How it is correct to make it?

Upvotes: 3

Views: 2593

Answers (1)

Martin Moser
Martin Moser

Reputation: 6267

You need to use a LayoutTransform. a RenderTransform doesn't re-calculate the size of the parent control.

Upvotes: 4

Related Questions