Change the background and foreground color of the Tab item Header

4 posts, 0 answers
  1. hamish
    hamish avatar
    44 posts
    Member since:
    Jun 2007

    Posted 16 Jun 2014 Link to this post

    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

  2. Evgenia
    Admin
    Evgenia avatar
    1406 posts

    Posted 19 Jun 2014 Link to this post

    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.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. hamish
    hamish avatar
    44 posts
    Member since:
    Jun 2007

    Posted 19 Jun 2014 in reply to Evgenia Link to this post

    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
  5. Evgenia
    Admin
    Evgenia avatar
    1406 posts

    Posted 19 Jun 2014 Link to this post

    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.
     
Back to Top