Skip to content

DevExpress-Examples/wpf-tabcontrol-customize-background-based-on-tab-state

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WPF Tab Control - Customize Tab Background for Selected, Focused, and Hovered States

This example demonstrates how to customize the background color of tabs based on their state (selected, focused, hovered).

WPF Tab Control - Customize Tab Background for Selected, Focused, and Hovered States

The following properties are used:

<dx:DXTabControl Name="tabControl" BackgroundTemplate="{StaticResource TabControlBackground}">
    <dx:DXTabControl.ItemContainerStyle>
        <Style TargetType="dx:DXTabItem">
            <Setter Property="HoverBackgroundTemplate" Value="{StaticResource TabItemHoverBackground}"/>
            <Setter Property="NormalBackgroundTemplate" Value="{StaticResource TabItemNormalBackground}"/>
            <Setter Property="SelectedBackgroundTemplate" Value="{StaticResource TabItemSelectedBackground}"/>
            <Setter Property="FocusedBackgroundTemplate" Value="{StaticResource TabItemFocusedBackground}"/>
        </Style>
    </dx:DXTabControl.ItemContainerStyle>
    <dx:DXTabItem Header="Original Text">
        <TextBox/>
    </dx:DXTabItem>
    <dx:DXTabItem Header="Edited Text">
        <TextBox/>
    </dx:DXTabItem>
    <dx:DXTabItem Header="Result Text">
        <TextBox/>
    </dx:DXTabItem>
</dx:DXTabControl>

Files to Review

Documentation