开发者

WPF TabItem Background color when selected?

开发者 https://www.devze.com 2023-01-20 01:57 出处:网络
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.

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

精彩评论

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