This is a migrated thread and some comments may be shown as answers.

Change the background and foreground color of the Tab item Header

3 Answers 1103 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
hamish
Top achievements
Rank 1
hamish asked on 16 Jun 2014, 06:32 PM
I am trying to find a way to change the background color of JUST THE TABITEM HEADER - i.e. the background color of the control you click to change tabs. I have managed to change every other background and foreground color of every control using styles with the notable exception of this one.

Can someone please tell me the secret to achieve - any code examples would be appreciated

3 Answers, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 19 Jun 2014, 12:17 PM
Hi Hamish,

You can set custom color to the HeaderBackground property of the RadTabControl style by using our implicit styles mechanism like this:

<Style TargetType="telerik:RadTabControl" BasedOn="{StaticResource RadTabControlStyle}">
       <Setter Property="HeaderBackground" Value="Yellow" />
</Style>

Let me know if you need any further assistance.

Regards,
Evgenia
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
hamish
Top achievements
Rank 1
answered on 19 Jun 2014, 12:38 PM
Thank you for your reply however I did try this and continue to get the error that 'BasedOn="StaticResource..." could not be resolved. I have tried referencing both the Binaries and BinariesNoXaml but continue to get the same error. I have cleaned the project and tried all of the normal Visual Studio 'fixes' but continue to get this error and obviously the TAB ITEM header back color does not get changed. Please advise
0
Evgenia
Telerik team
answered on 19 Jun 2014, 01:11 PM
Hi Hamish,

Please mind that our Implicit styles mechanism works with NoXAML binaries only as their name implies these are binaries without XAML. It is importtant that you merge the resource files that actually contain the xaml and some relevant needed resources for our controls to get visualized. Please check whether all needed resources are merged in your App.xaml file. For example:

<ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/System.Windows.xaml"/>
        <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.xaml"/>
        <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>            
    </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

That's all you need to do to have the HeaderBackground property working. If the issue with not finding the BasedOn style persists -- please send us your runnable project so that we will be able to inspect  locally what's wrong with it.

Regards,
Evgenia
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
TabControl
Asked by
hamish
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
hamish
Top achievements
Rank 1
Share this question
or