C1ThemeController - How to set Them to default WinForms Theme, ie Them "(none)"

Posted by: hrvoje.zirdum on 29 November 2019, 3:22 am EST

    • Post Options:
    • Link

    Posted 29 November 2019, 3:22 am EST - Updated 4 October 2022, 12:28 am EST

    Is there a way to set No Theme, so that WinForms project have default colors. I used WordPad example where I can change Themes and when I change to other Theme than “(none)”, that works fine, but you can not revert back to “(none)”.

    Let me explain in steps:

    1. So when I first start the WinForms example WordPad app, it has default WinForms Theme, not C1Theme and that is ok. Theme is set to “(none)”. Image “1. WordPad example - Start App - Theme is by default set to - (none).png”.
    2. I change Theme to “Office2010Blue” and WinForms app changes Theme. That is also ok. Image “2. WordPad example - Change Theme to - Office2010Blue.png”.
    3. I change Theme back to “(none)” but Winforms app doesn’t change Theme. It is still “3. Office2010Blue”. That is not ok. Image “WordPad example - Change Theme back to - (none).png”.

    Is there a way to revert back to Theme (none), ie to have default WinForms Theme?

    Thank You.

    Regards,

    Hrvoje

  • Posted 29 November 2019, 8:35 am EST

    Hello,

    New Ribbon does not contain any method like ResetVisualStyle so you need to set the null theme on the ChangeCommitted event of ComboBox manually by code.

    Code snippet is given below :

    string theme1 = C1ThemeController.NoTheme;
    C1ThemeController.ApplyThemeToControlTree(this, new C1Theme() { Name = theme1 });
    

    Please go through the attached sample demonstrating the same.

    Regards,

    Prabhat Sharma.

    RibbonDemoTheme1.zip

  • Posted 29 November 2019, 8:48 am EST

    Thank You.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels