2010-10-17 15 views

cevap

74

TabControl.TabStripPlacement Property'u denediniz mi?

Aşağıdaki örnek, sol taraftaki sekmeleri konumlandıran bir sekme denetimi oluşturur.

<TabControl TabStripPlacement="Left" Margin="0, 0, 0, 10"> 
    <TabItem Name="fontweight" Header="FontWeight"> 
    <TabItem.Content> 
     <TextBlock TextWrapping="WrapWithOverflow"> 
     FontWeight property information goes here. 
     </TextBlock> 
    </TabItem.Content> 
    </TabItem> 

    <TabItem Name="fontsize" Header="FontSize"> 
    <TabItem.Content> 
     <TextBlock TextWrapping="WrapWithOverflow"> 
     FontSize property information goes here. 
     </TextBlock> 
    </TabItem.Content> 
    </TabItem> 
</TabControl> 
13

Bu kodu denemelisiniz:

<TabControl.Resources> 
      <Style TargetType="{x:Type TabItem}"> 
       <Setter Property="HeaderTemplate"> 
        <Setter.Value> 
         <DataTemplate> 
          <ContentPresenter Content="{TemplateBinding Content}"> 
           <ContentPresenter.LayoutTransform> 
            <RotateTransform Angle="270" /> 
           </ContentPresenter.LayoutTransform> 
          </ContentPresenter> 
         </DataTemplate> 
        </Setter.Value> 
       </Setter> 
       <Setter Property="Padding" Value="3" /> 
      </Style> 
     </TabControl.Resources> 
0

yukarıdaki rkirac cevabı dayanarak. Küresel bir stil oluşturmak istemiyorsanız, aynı şeyi TabControl.ItemContainerStyle içine koyabilirsiniz, bu yalnızca söz konusu TabControl'u etkileyecektir. Aşağıdaki basit bir örnektir:

<TabControl TabStripPlacement="Left"> 
    <TabControl.ItemContainerStyle> 
    <Style TargetType="TabItem"> 
     <Setter Property="LayoutTransform"> 
     <Setter.Value> 
      <RotateTransform Angle="270" /> 
     </Setter.Value> 
     </Setter> 
    </Style> 
    </TabControl.ItemContainerStyle> 
</TabControl> 
İlgili konular