|
Article relates to
|
RadControls for WinForms
|
|
Created by
|
Nikolay Diyanov
|
|
Last modified
|
Feb 17, 2009
|
|
Last modified by
|
Nikolay Diyanov
|
HOW-TO
Inherit the original control themes from RadControls
SOLUTION
When you inherit from a RadControl (or any RadControl descendant), the original control themes are not automatically inherited. The good thing is that this behavior can be overridden very easily by overriding the ThemeClassName property of the descendant of RadControl:
C#
VB.NET
The example above uses RadButton as a base class. Since the themes depend on the type of the themed class (which is changed when you inherit), using the described override makes base control themes available in the descendant control. The sample projects below demonstrate the approach.
When you inherit from a RadElement descendant (for example RadButtonElement), you need to override the ThemeEffectiveType property. This will allow you to have the styling applied to the instance of your custom element class:
Please
Sign In
to rate this article.