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

Theme to all controls (besides ControlDefault)

3 Answers 188 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
Stargazer
Top achievements
Rank 2
Stargazer asked on 20 Nov 2008, 12:03 PM
Hi!

Some where long the line, I've read that the Q3 release of winforms would have a common theme to all controls, besides the ControlDefault one.

My question is how, if so, has this been implemented? All the themes available have properties to work on every control?

3 Answers, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 20 Nov 2008, 03:57 PM
Hello Stargazer,

Thank you for writing.

Yes, we have several common themes for our controls. You can find detailed information on them in the help.

In Q3 2008 we introduced a new feature called Theme Color Blending. It allows you to style entire applications very easily. You should to set a new color for the theme’s parameter and that's all! The new color scheme will be applied to all Telerik WinForms controls in your application. For more info you may take a look at this blog post on theme color blends:
http://blogs.telerik.com/MihailValkov/Posts/08-10-31/Chameleon_skinning_coming_up_to_WinForms_in_Q3_2008.aspx

Here is short code sniped that demonstrate this.

Theme currentThemeTheme currentTheme = ThemeResolutionService.GetTheme("Desert");//we will modify desert theme 
if (currentTheme.ThemeProperties.ContainsKey("BaseColor"))          
    currentTheme.ThemeProperties["BaseColor"] = (HslColor)Color.Red; 
  
I hope this helps.

Greetings,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Stargazer
Top achievements
Rank 2
answered on 21 Nov 2008, 04:51 PM
Hi Peter!

Understood! ;)

Although, I think your snippet is wrong, and it will bite on people's behinds if they use it as it is ;)

Theme currentTheme = ThemeResolutionService.GetTheme("Desert");//we will modify desert theme  
if (currentTheme.ThemeProperties.ContainsKey("BaseColor")) 
    currentTheme.ThemeProperties["BaseColor"] = HslColor.FromColor(Color.Red);  

I think it should be more like that. At least the other example failed to compile because of the first line and the last (the cast is invalid, it says). Am I right?

;)


0
Peter
Telerik team
answered on 24 Nov 2008, 08:36 AM
Hi Stargazer,

Yes, you are right - this cast is invalid. Thank you for the cooperation.

 
Regards,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Themes and Visual Style Builder
Asked by
Stargazer
Top achievements
Rank 2
Answers by
Peter
Telerik team
Stargazer
Top achievements
Rank 2
Share this question
or