Posted 6 November 2017, 9:37 am EST
How to apply theme to all the controls in a win form? I have controls like ribbon, flex grid, combobox, textboxes, label etc.
Forums Home / ComponentOne / WinForms Edition
Posted by: bilash.shrestha on 6 November 2017, 9:37 am EST
Posted 6 November 2017, 9:37 am EST
How to apply theme to all the controls in a win form? I have controls like ribbon, flex grid, combobox, textboxes, label etc.
Posted 7 November 2017, 4:02 am EST
Hi,
place a “C1ThemeController” on your form. If you use a fixed theme, you can assign the theme at design time.
Otherwise, use this code snippet:
this.c1ThemeController.Theme = "MyTheme";
C1Theme theme = C1ThemeController.GetThemeByName(this.c1ThemeControllerTheme, true));
//Apply Theme to form:
C1ThemeController.ApplyThemeToControlTree(this, theme);
Hope this helps
Wolfgang
Posted 7 November 2017, 4:32 am EST
Hello,
Thank you, Wolfgang.
In addition to the above response, I am attaching a sample implementing C1Themes for various C1 controls. You can comment the code to see the effects of the theme applied at design time.
Also, you can create you own themes using the C1ThemeDesigner found at the default location C:\Program Files (x86)\ComponentOne\Apps
\v4.0\C1ThemeDesigner.4.exe. You can learn more about C1Themes from the below mentioned documentation link:
http://help.grapecity.com/componentone/NetHelp/c1themes/webframe.html
Best Regards,
Esha
prj_Themes.zip