Home / Community & Support / Knowledge Base / RadControls for WinForms / Themes and Styling / Set the ThemeName at an application level

Set the ThemeName at an application level

Article Info

Rating: 4

Article information

Article relates to

 RadControls for WinForms

Created by

 Nikolay Diyanov, Telerik

Last modified

 11 Jul, 2008

Last modified by

 Nikolay Diyanov, Telerik



PROBLEM
When your application has many and different controls, you may find it inconvenient to go through all the controls and set their ThemeName property.

HOW TO
Set a theme at an application level, i.e. for all the RadControls for WinForms at once.

SOLUTION
In the start-up form's constructor set the static ApplicationThemeName property of the ThemeResolutionService class to a theme name:
ThemeResolutionService.ApplicationThemeName = "Office2007Black"

If the value of this property is null or empty each control will be assigned a theme, corresponding on the RadControl.ThemeName property of the control. Otherwise the ThemeName property will be disregarded. If a specific control in the application has no theme registered with the name specified by ApplicationThemeName, it will be assigned its ControlDefault theme name.

Comments

If you'd like to comment on this KB article, please, send us a Support Ticket.
Thank you!

Please Sign In to rate this article.