Rad
Controls for WinForms
Search RadControls for WinForms
Contents
Overview
What is new
Release Notes
Installation, Deployment and Distribution
Licensing
Buttons
Calendar
Carousel
Chart
Clock
CommandBar
Dock
DesktopAlert
DropDown and ListControl
Editors
Forms and Dialogs
GridView
ListView
Menus
MultiColumnComboBox
PageView
Panels and Labels
Panorama
PropertyGrid
RibbonBar
RichTextBox
Rotator
Scheduler
Shortcuts
SpellChecker
SplitContainer
Track and Status Controls
TreeView
Wizard
Telerik CAB Enabling Kit
Telerik Presentation Framework
Themes
Visual Style Builder
Using default themes
Using a default theme for the entire application
Using custom themes
Advanced topics
Adding custom redistributable themes to your application
Creating a theme component
Adding a custom theme as a resource
Adding a custom theme as a file
Color Blending
Tools
For More Help
API Reference
Collapse All
Expand All
Code: All
Code: Multiple
Code: C#
Code: Visual Basic
C#
Visual Basic
RadControls for WinForms
Adding a custom theme as a resource
Send Feedback
Adding a custom theme as a resource
Create a new Windows Application, drag a RadControl, i.e. RadButton, from your Toolbox to your form.
Create a new custom theme and save it somewhere on your hard drive.
Right-click the project node in the Solution Explorer, choose
Add >> Existing Item
and add the custom theme file. This will automatically copy the custom theme file in your project's directory. You can also add a new folder (
Add >> New Folder
) where you can put your custom theme.
Set the custom theme's
Build Action
property to
Embedded Resource
.
Add a RadThemeManager to the form.
From the RadThemeManager's Action Menu (click the Smart Tag to open it) choose
Load Theme from resources
.
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
ProjectName.FolderName.ThemeFileName.Extention
if the theme file is in a folder as mentioned in step 3, otherwise it is just
ProjectName.ThemeFileName.Extention
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:
ProjectName.ThemeFileName.Extention
.
Build the application. This will include the custom theme file in your assemblies.
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.