# Adding a custom theme as a resource

1. Create a new Windows Application, drag a RadControl, i.e. RadButton, from your Toolbox to your form.

2. Create a new custom theme and save it somewhere on your hard drive (save it as XML files).

3. Right-click the project node in the Solution Explorer, choose **Add >> Existing Item** and add the custom theme file(s) together with the theme repository file. This will automatically copy the custom theme file in your project's directory. You can also add a new folder (**Add >> New Folder**) to place your theme files.

4. Set the custom theme's **Build Action** property to **Embedded Resource**.

5. Add a RadThemeManager to the form.

6. From the RadThemeManager's Action Menu (click the Smart Tag to open it) choose **Load Theme from resources**.

7. You will be prompted to enter the resource location. C# and VB.NET compilers differ from one another, so:

* In a C# application the pattern is **ProjectDefaultNamespace.ContainingFolderName.ThemeFileName.Extension** if the theme file is in a folder as mentioned in step 3, otherwise it is just **ProjectName.ThemeFileName.Extension**

* In a VB.NET application, it does not matter whether the theme file is in a folder or not, the pattern is always the same: **ProjectRootNamespace.ThemeFileName.Extension**.

1. Perform the same action for all theme files needed and also for the  **theme repository**.

2. Build the application. This will include the custom theme file in your assemblies.

3. Now you can apply the theme to the RadButton.

> note To be sure about the theme resource location in step 7, you can use Reflector. After building the project simply reflect the built assembly/executable and you will see it.

> important If the form with the theme manager will be opened multiple time in the life cycle of the application, the theme manager needs to be disposed explicitly. A suitable place to call its Dispose method is the Closing event of the form.

## See Also

* [Adding a custom theme as a file](https://www.telerik.com/products/winforms/documentation/styling-and-appearance/advanced-topics/adding-custom-redistributable-themes-to-your-application/adding-a-custom-theme-as-a-file)

* [Creating a theme component](https://www.telerik.com/products/winforms/documentation/styling-and-appearance/advanced-topics/adding-custom-redistributable-themes-to-your-application/creating-a-theme-component)
