WPF TabControl Tabs in the upper right corner

I have a WPF TabControl that I want to put tabs with TabStripPlacement from Top , but I want them to display with the correct orientation on top. I achieved this easily by doing a FlowDirection from RightToLeft ; however, I do not want child controls to inherit RightToLeft FlowDirection .

Is it possible to arrange the tabs from the top right without using the FlowDirection ?

+6
c # wpf xaml direction tabcontrol
source share
2 answers

I'm not sure about this, you can always try to create your own style for TabControl to indicate how tabs are laid out. Alternatively, simply use FlowDirection and specify FlowDirection as LeftToRight for each individual TabItem so that the child controls display normally.

+4
source share

This question is old, but this is what came when I searched Google. The answer was not exactly what I wanted. So I researched this in Expresion Blend. I decided that the TabPanel should have HorizontalAlignment = "Right". Therefore, for the future it is just as simple:

 <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 problems with this.

+5
source share

All Articles