views:

7112

answers:

2

I am trying to create a Tab Control in WPF that has the tabs arranged down the right side of the control, with the text rotated 90 degrees The look is similar to those plastic tabs you can buy and use in a notebook. I have tried changing the TabStripPlacement to Right, but it just stacks the tabs up on the top right side of the control - not at all what I had in mind.

+25  A: 

The effect I believe you are seeking is achieved by providing a HeaderTemplate for the TabItem's in you Tab collection.

<TabControl TabStripPlacement="Right">
  <TabControl.Resources>
    <Style TargetType="{x:Type TabItem}">
      <Setter Property="Padding" Value="4" />
      <Setter Property="HeaderTemplate">
        <Setter.Value>
          <DataTemplate>
            <ContentPresenter Content="{TemplateBinding Content}">
              <ContentPresenter.LayoutTransform>
                <RotateTransform Angle="90" />
              </ContentPresenter.LayoutTransform>
            </ContentPresenter>
          </DataTemplate>
        </Setter.Value>
      </Setter>
    </Style>
  </TabControl.Resources>
  <TabItem Header="Tab Item 1" />
  <TabItem Header="Tab Item 2" />
  <TabItem Header="Tab Item 3" />
  <TabItem Header="Tab Item 4" />
</TabControl>

Hope this helps!

Brad Leach
If the Tabs are 'longer' than the grid is tall, is there some way to have the tabs scroll, to reveal the ones that aren't initially visible?
Number8
... or have multiple columns of tabs, as happens when the tabs are along the top of the control?
Number8
A: 

I'm looking for the same answer -how to 'stack' tabs that have TabStripPlacement="Right"... Any help would be appreciated!

Julie