Designer uses one theme, runtime uses another

1 Answer 72 Views
Themes and Visual Style Builder
Ian
Top achievements
Rank 2
Bronze
Iron
Iron
Ian asked on 25 Jan 2022, 12:13 PM

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

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 27 Jan 2022, 02:01 PM
Hello, Ian,   

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.

Ian
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 10 Feb 2022, 10:49 AM

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.

Ian
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 10 Feb 2022, 11:06 AM

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 ?

Ian
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 10 Feb 2022, 11:15 AM

I can now confirm that, in exactly the same project, the form looks OK at runtime when running as a stand-alone Windows Forms app, but wrong when running as a DLL. 
Ian
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 11 Feb 2022, 05:28 PM

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.

Ian
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 13 Feb 2022, 10:12 AM

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.)

Ian
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 13 Feb 2022, 10:42 AM

Oh, and all Apps and .EXE are using 2011. 1 .118 version.
Dess | Tech Support Engineer, Principal
Telerik team
commented on 14 Feb 2022, 09:47 AM

Hello, Ian,    

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.
Tags
Themes and Visual Style Builder
Asked by
Ian
Top achievements
Rank 2
Bronze
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or