How to change the DXTabControl Background Color?

2019-03-06 14:38发布

问题:

I have a DXTabControl and I want to change the Background Color of the DXTabControl.
How can I do that?

<dx:DXTabControl>
    <dx:DXTabItem  Header="System" Margin="0">
        <dxe:TextEdit x:Name="txtChargeNo"  Background="#D5D6D8"  ShowNullText="True" NullText="Sarj No"  Height="30" FontSize="16"/>
    </dx:DXTabItem>
    <dx:DXTabItem x:Name="tbPast" Header="Past">
    </dx:DXTabItem>
</dx:DXTabControl>

回答1:

Did you try setting the BackgroundColor property of the DXTabItem?:

<dx:DXTabItem  Header="System" Margin="0" BackgroundColor="Red">

You may also want to refer to the following links.

How to: Change Tab Background in DXTabControl and Keep the Default Gradient and Highlight Effects: https://documentation.devexpress.com/WPF/115323/Controls-and-Libraries/Layout-Management/Tab-Control/Examples/How-to-Change-Tab-Background-in-DXTabControl-and-Keep-the-Default-Gradient-and-Highlight-Effects

How to: Change the Tab Background in DXTabControl when a Tab Is Selected, Focused Or Hovered: https://documentation.devexpress.com/WPF/115324/Controls-and-Libraries/Layout-Management/Tab-Control/Examples/How-to-Change-the-Tab-Background-in-DXTabControl-when-a-Tab-Is-Selected-Focused-Or-Hovered

How to change the DXTabControl background: https://www.devexpress.com/Support/Center/Question/Details/T321538/how-to-change-the-dxtabcontrol-background