开发者

WPF TabItem Background color when selected?

Any clue on why the code bellow does not work ? I'm trying to set the background color of a tab item when selected to red.

  <Style x:Key="TabItemStyle" TargetType="{x:Type TabItem}">
       开发者_运维百科 <Setter Property="Background" Value="White"/>
        <Style.Triggers>
            <Trigger Property="IsSelected"    Value="True">
                <Setter Property="Background" Value="Red"/>
            </Trigger>
        </Style.Triggers>
    </Style>

Regards, MadSeb


Here is a good WPF tab project covering different aspects of setters and triggers which may assist you. Its kind of cool functionality too :)

http://www.dotnetspark.com/kb/1867-create-tab-control-wpf.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜