Theme to all controls (besides ControlDefault)

4 posts, 1 answers
  1. Stargazer
    Stargazer avatar
    73 posts
    Member since:
    Jan 2007

    Posted 20 Nov 2008 Link to this post

    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?
  2. Answer
    Peter
    Admin
    Peter avatar
    1148 posts

    Posted 20 Nov 2008 Link to this post

    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.

    1 Theme currentThemeTheme currentTheme = ThemeResolutionService.GetTheme("Desert");//we will modify desert theme 
    2 if (currentTheme.ThemeProperties.ContainsKey("BaseColor"))          
    3     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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Stargazer
    Stargazer avatar
    73 posts
    Member since:
    Jan 2007

    Posted 21 Nov 2008 Link to this post

    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?

    ;)


  5. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 24 Nov 2008 Link to this post

    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.
Back to Top