WPF之TabControl控件的竖向显示

 <TabControl TabStripPlacement="Left">
                <TabControl.Resources>
                    <Style TargetType="{x:Type TabItem}">
                        <Setter Property="Padding" Value="5" />
                        <Setter Property="HeaderTemplate">
                            <Setter.Value>
                                <DataTemplate>
                                    <ContentPresenter Content="{TemplateBindingProperty=ContentControl.Content}">
                                        <ContentPresenter.LayoutTransform>                                                        <RotateTransform Angle="-90" />
                                        </ContentPresenter.LayoutTransform>
                                    </ContentPresenter>
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </TabControl.Resources>
                <TabItem Name="backgroundcolor2" Header="Tab1" />
                <TabItem Name="foregroundcolor2" Header="Tab2" />
  </TabControl>

转载于https://social.msdn.microsoft.com/Forums/office/zh-CN/972a6c45-eb56-477c-b62a-1c8eb8666297/wpf30340tabcontrol33021314462152125490210152152765311?forum=wpfzhchs

猜你喜欢

转载自blog.csdn.net/jiuzaizuotian2014/article/details/82850162