Question

I have a WPF TabControl that I want to position the tabs with a TabStripPlacement of Top, but I want them to display with a right orientation on top. I've achieved that easily by doing a FlowDirection of RightToLeft; however, I don't want the children controls to inherit the RightToLeft FlowDirection.

Is there any way to position the tabs on the top on the right without using the FlowDirection property?

Was it helpful?

Solution

I'm not sure about this, you could always try creating a custom style for the TabControl to specify how the tabs are laid out. Alternatively, just use FlowDirection and specify the FlowDirection as LeftToRight on each individual TabItem so the child controls display normally.

OTHER TIPS

This question is old, but it is what came up when I google searched. The answer wasn't really what I wanted. So I researched this in Expresion Blend. I determined that the TabPanel needs to have HorizontalAlignment="Right" style. So for future, it is as easy as this:

<TabControl>
    <TabControl.Resources>
        <Style TargetType="TabPanel">
            <Setter Property="HorizontalAlignment" Value="Right"/>
        </Style>
    </TabControl.Resources>
    <TabControl.Items>
        <TabItem Header="Tab 1"></TabItem>
        <TabItem Header="Tab 2"></TabItem>
        <TabItem Header="Tab 3"></TabItem>
    </TabControl.Items>
</TabControl>

Let me know if you see any issues with this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top