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

Override ApplicationThemeName

1 Answer 335 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
Erwin
Top achievements
Rank 1
Erwin asked on 22 Aug 2012, 10:20 AM
Hello,

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 :-)

1 Answer, 1 is accepted

Sort by
0
Boryana
Telerik team
answered on 24 Aug 2012, 02:55 PM
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,
Boryana
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
Themes and Visual Style Builder
Asked by
Erwin
Top achievements
Rank 1
Answers by
Boryana
Telerik team
Share this question
or