Posted 23 March 2018, 3:30 am EST
Hello,
I tried removing the theme for a single control in a c1form but its not working. Can you please help me out. How can I not apply theme to a single control like PictureBox?
Forums Home / ComponentOne / WinForms Edition
Posted by: niru.lama on 23 March 2018, 3:30 am EST
Posted 23 March 2018, 3:30 am EST
Hello,
I tried removing the theme for a single control in a c1form but its not working. Can you please help me out. How can I not apply theme to a single control like PictureBox?
Posted 26 March 2018, 12:20 am EST
Hello Niru,
PictureBox does not lie among the Themeable Microsoft Controls. Please have a look at the below mentioned documentation link providing a list of MS controls that are themeable:
http://help.grapecity.com/componentone/NetHelp/c1themes/webframe.html#ThemeableMicrosoftControls%20.html
Thus, while adding C1ThemeController and also through the Set Themes smart tag, one can select whether to apply theme to a particular themeable control or not.
For PictureBox, you can get rid of the styles applied to the control by removing them manually.
Let us know if you need further assistance.
Best Regards,
Esha
Posted 26 March 2018, 2:02 am EST
Hello,
I am quite aware that the PictureBox control is not displayed in the C1ThemeController while applying theme. Can you please make a clear picture further on removing the controls manually ? When I tried removing the themes on the form it messed up the theme application for other controls as well. I tried removing the theme by following piece of code.
Dim NoTheme As String = String.Empty
C1ThemeController1.Theme = NoTheme
Posted 26 March 2018, 3:04 am EST
Hello,
Do you wish to remove the theme from a form or from some control placed on it?
If it is for the form, you can set the Theme on C1ThemeController property of the form to None, from the property grid of the form.
With the code that you have shared, the default theme for all the controls on the form is lost.
Please share the stripped down application showing the issue you are facing. This will help us assist you further.
Best Regards,
Esha
Posted 26 March 2018, 6:49 am EST
Hello,
I just want to remove the theme for some controls, for instance PictureBox. I created new project and tried creating the scenerio but it’s not allowing me to attach the zip file . So, you can simply create a form with C1DockingTab and a pictureBox at the right hand side of the form. Now add a themecontroller and choose any theme e.g. Office2010Barbie. The theme is applied in the PictureBox as well. How can I not apply theme to that single control in the application?
Posted 27 March 2018, 12:38 am EST
Hello,
Thank you for the clarity.
Here, you may have to manually remove the BackColor applied to the PictureBox i.e. go to its BackColor property and set it to Control from the System tab or use the below mentioned code:
PictureBox1.BackColor = DefaultBackColor
Hope it helps.
Best Regards,
Esha
Posted 27 March 2018, 1:01 am EST
Hello,
Thank you so much, it resolved my issue.