| ThemeController Overview > Theme Sources |
In an application, themes can come from the following sources:
The first two theme sources are available at design time via the C1ThemeController properties and designer actions. At runtime, you can also load themes in code from .c1theme files on disk using methods available on the C1ThemeController component.
For example the following code shows how to apply the built-in theme through code using the Register and SetTheme methods:
| C# |
Copy Code
|
|---|---|
|
//Register the theme file with the C1ThemeController;
C1.Win.C1Themes.C1ThemeController.RegisterTheme(@"C:\Users\Documents\Visual Studio 2010\Projects\ThemesBuild6\ThemesBuild6\NewOffice2013White.c1theme");
//Apply it to a control and use the theme name this.c1ThemeController1.SetTheme(c1MainMenu1, "NewOffice2013White") |
|
| Visual Basic |
Copy Code
|
|---|---|
|
'Register the theme file with the C1ThemeController C1.Win.C1Themes.C1ThemeController.RegisterTheme("C:\Users\Documents\Visual Studio 2010\Projects\ThemesBuild6\ThemesBuild6\NewOffice2013White.c1theme") 'Apply it to a control, use the theme name, not the file name Me.c1ThemeController1.SetTheme(someControl, "NewOffice2013White") |
|