RadControls for WinForms

Creating a theme component:

Since Q2 2008, a new approach for using all the Telerik predefined themes was introduced. It represents isolating a set of themes in a separate class library project. This class library project is actually the theme component, which you can later use in your main project. This approach greatly simplifies the way of adding and removing themes to your project and helps in displaying the themes in design-time.
  1. Add a new Class Library project to your current solution.
  2. Add your theme files and their Build Action to Embedded Resource.
  3. Add a new class to represent your theme component to the project:
    Copy[C#] Creating custom theme component
    class CustomTheme : Component
    {
        public CustomTheme()
        {
            ThemeResolutionService.RegisterThemeFromStorage(ThemeStorageType.Resource, @"ProjectDefaultNameSpace.FolderName.ThemeName1.xml");
            ThemeResolutionService.RegisterThemeFromStorage(ThemeStorageType.Resource, @"ProjectDefaultNameSpace.FolderName.ThemeName2.xml");     
        }
    }
    Copy[VB.NET] Creating custom theme component
    Public Class CustomTheme
        Inherits Component
        Public Sub New()
            MyBase.New()
            ThemeResolutionService.RegisterThemeFromStorage(ThemeStorageType.Resource, "ProjectDefaultNameSpace.FolderName.ThemeName1.xml")
            ThemeResolutionService.RegisterThemeFromStorage(ThemeStorageType.Resource, "ProjectDefaultNameSpace.FolderName.ThemeName2.xml")
        End Sub
    End Class
Please note that your class should inherit Component. As to the path string, it is constructed as follows: ProjectDefaultNamespace.ContainingFolder.ThemeFileName.xml. The ContainingFolder is only needed if the xml files are in folders in the project structure (C# only). Regarding VB.NET, even if the theme file is in a folder, you should not include the folder name in the path string. When you compile the project, you will be able to drag the this component to the forms in all the projects in you solution which will load the corresponding theme, both runtime and designtime. A sample project demonstrating the approach is attached below. In it we have a project, named EnterpriseBlack where the theme is in a EBlackThemesFolder.