Override ApplicationThemeName

2 posts, 0 answers
  1. Erwin
    Erwin avatar
    74 posts
    Member since:
    Apr 2009

    Posted 22 Aug 2012 Link to this post


    Good Day.
    I have set the themes of out application to  "Office2010Blue"
           Dim theme As New Office2010BlueTheme()
           ThemeResolutionService.ApplicationThemeName = "Office2010Blue"
    All the Controls Theme became "Office2010Blue"
    This is OK for me.

    My Question is: I have a RadPageView. Is it possible to set its theme to the Default theme "ControlDefault". I like the the color of the Default theme for the PageView.

    I have read that the ApplicationThemeName is greater than ThemeName in controls.
    Can we override then ApplicationThemeName for specific controls?

    Is there a workaround for this? or
    Should i set the individual theme for all controls by ThemeName so that i can have multiple themes
    I dont want to edit the themes using StyleBuilder.
    I just want to know if their is an easy solution or workaround for this.

    Thank you :-)

  2. Boryana
    Boryana avatar
    330 posts

    Posted 24 Aug 2012 Link to this post

    Hi Erwin,

    Thank you for contacting us.

    Once you set the ApplicationThemeName property the ThemeName properties of all RadControls on the form are disregarded. You will be able to find more information on the topic here: http://www.telerik.com/support/kb/winforms/themes/set-the-themename-at-an-application-level.aspx. You can easily achieve the desired effect through using the ApplyThemeToControlTree method twice. Here is a sample snippet:
    ThemeResolutionService.ApplyThemeToControlTree(this, "Office2010Blue");
    ThemeResolutionService.ApplyThemeToControlTree(this.radPageView1, "");

    The first line will apply the Office2010Blue theme to all controls on you form, regardless if it is a standard MS Form or a RadForm. The second line forces the RadPageView to revert to its ControlDefault theme. The attached sample project demonstrates the suggested approach.

    I hope you find my answer helpful. Let me know if you encounter further issues. 

    All the best,
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Back to Top