I've made the change to the App.config file to set to use the 'Fluent' Theme for all forms everywhere in the application:
<add key="TelerikWinFormsThemeName" value="Fluent" />
..which looks perfect in the Designer, but the runtime is still using some other theme.
Designer
Runtime
The form does not specify a Theme, so I thought it would use the 'Fluent' theme which I specified.
Do I need to do something else to make the runtime form use the right theme? I'm confused....
1 Answer, 1 is accepted
Indeed, the app.config file allows you to specify what theme to used for the design time experience:
https://docs.telerik.com/devtools/winforms/styling-and-appearance/default-theme#fluent-theme-as-default
If no other theme is applied programmatically to the respective controls or the entire application, you are expected see the same theme at run time as well. If this is not the observed behavior, there is some other implementation that affects the controls' style. That is why we will need to have a look at the exact project demonstrating the exact behavior. It would be greatly appreciated if you can provide the project in the support ticket that you have opened on the same topic. Thus, we would be able to make an adequate analysis of the precise case and provide further assistance. Thank you in advance.
I am looking forward to your reply.
Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
Is it importatnt that this project is still using 2021.2.511 ?
I've removed every mention of Themes of tssp files from the whole application, and it's still there.
Next step is deleting all the content from the App, and see if I can get you a version to look at.
My App runs as a DLL, as an add-in to another product, so to make it debuggable by you, I made it into a forms application, with a simple 'hello world' form
So I exported everything in the app from SVN to a new folder and (2) made it a Forms application, suddenly my 'hello world' form looks the same at design AND runtime!
Does this help you in any way ?
Only solution to this looks to be to create a totally new project, then import all the code, and hope that this makes a diffrence.
I can't get you a version to debug, as the problem only comes when the App is made into DLL, and called by another program, which you don't have.
I have now created a stand-alone test .EXE, to call my 'hello world' DLL, instead of using the product that would normally call it.
And everything works perfectly - design-time and runtime look the same.
But when it is called from the product, the 'hello world' DLL still does not use the 'Fluent' theme, as defined in the DLL's App.config file.
So the problem is now more localised:
- My own simple .EXE test program (which does not even have the App.config set to use Fluent, but looks ok anyway!) can call the DLL, and it uses 'Fluent'
- When the larger product, (where it has an API to call out to 'Add-in' DLLs like mine.) calls the 'hello world' DLL, it uses the old (blue background) theme, which I think was the default for previous version of the Telerik framework.
But how can it make a difference where the 'hello world' app DLL is called from ?
This is not a generic problem. I have another add-in DLL which works perfectly. I can even allow users to change the global theme in that DLL, which is cool.
So there's something in the setup of how this 'hello world' DLL is being called which make it forget to use 'Fluent'.
Any ideas please?
(There's still no point me sending you my stand-alone .EXE, and the 'hello world' DLL, as they work fine together.)
I would like to note that as of R1 2021 (version 2021.1.122), it is possible to define which theme is your default theme (e.g. ControlDefault) for the controls even at design time. This can be defined in the App.config file. If you are using an older version than the version in which this functionality was introduced, it is expected to observe different behavior.
In case you are still experiencing any further difficulties, feel free to submit a support ticket from your Telerik account and provide a sample runnable VS project demonstrating the undesired behavior that you are facing. Thus, we would be able to investigate the precise case and conclude what leads to this behavior. Thank you in advance.