# Inherit themes from RadControls derivatives

## Inherit from a RadControl descendant

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#
        
public class RadCustomButton : RadButton  
{ 
    public override string ThemeClassName  
    { 
        get 
        { 
            return typeof(RadButton).FullName;  
        }
    }
}

```

```VB.NET
Public Class RadCustomButton
    Inherits RadButton
    Public Overrides Property ThemeClassName As String
        Get
            Return GetType(RadButton).FullName
        End Get
        Set(value As String)
            MyBase.ThemeClassName = value
        End Set
    End Property
End Class

```

 

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.

## Inherit from a RadElement descendant

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:

 

 

```C#
        
public class MyRadButtonElement : RadButtonElement     
{ 
    protected override Type ThemeEffectiveType     
    { 
        get    
        { 
            return typeof(RadButtonElement);     
        }
    }
}

```

```VB.NET
Public Class MyRadButtonElement
Inherits RadButtonElement
    Protected Overrides ReadOnly Property ThemeEffectiveType() As Type
        Get
            Return GetType(RadButtonElement)
        End Get
    End Property
End Class

```



## See Also

* [Animations](https://www.telerik.com/products/winforms/documentation/telerik-presentation-framework/animations)

* [Dependency Properties](https://www.telerik.com/products/winforms/documentation/telerik-presentation-framework/dependency-properties)

* [Handling User Input](https://www.telerik.com/products/winforms/documentation/telerik-presentation-framework/handling-user-input)

* [HTML-like Text Formatting](https://www.telerik.com/products/winforms/documentation/telerik-presentation-framework/html-like-text-formatting)

* [Microsoft Active Accessibility Support](https://www.telerik.com/products/winforms/documentation/telerik-presentation-framework/microsoft-active-accessibility-support)

* [Override Theme Settings at Run Time](https://www.telerik.com/products/winforms/documentation/telerik-presentation-framework/override-theme-settings-at-run-time)

* [RadMarkupDialog](https://www.telerik.com/products/winforms/documentation/telerik-presentation-framework/markup-dialog/radmarkupdialog)
