This is a migrated thread and some comments may be shown as answers.

Custom Shape/Theme applied to a specific button

1 Answer 139 Views
Tools - VSB, Control Spy, Shape Editor
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 23 Apr 2009, 04:02 AM
Hi,

On my form I have two buttons that I wish to have a custom shape, and the rest to be normal.
How do I do this?
I made custom shape by clicking the button, opening theme builder, setting custom shape, saving theme, adding theme as resource in project, adding theme manager, loading the theme from resource in theme manager.
But then the shape is applied to all buttons on the form.
How do I get custom shapes/look/feel/behaviour on just two of the buttons?

Regards,
David

1 Answer, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 24 Apr 2009, 03:27 PM
Hi David,

Thank you for writing.

When you create a theme with Theme Builder (aka Visual Style Builder), it is output in an .xml file. When you load this xml file with RadThemeManager, by default the theme is not set to any control, but you can select the theme by choosing it's name from the ThemeName property in the button's smart tag. This way only this button will have the theme. The only way the theme can be applied to every button is when you set the ThemeResolutionService.ApplicationThemeName property or if you call ThemeResolutionService.ApplyThemeToControlTree(Control parent, string themeName) by passing your control container as the first argument and the your theme name as the second argument.
 
I have attached a sample application with a theme added as a resource, like you described. Theme is applied to only one of the buttons.
 
Please have a look at the project and write back if you need further assistance.

Sincerely yours,
Victor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Tools - VSB, Control Spy, Shape Editor
Asked by
David
Top achievements
Rank 1
Answers by
Victor
Telerik team
Share this question
or