This is a migrated thread and some comments may be shown as answers.

Theme changing events?

1 Answer 253 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Swaroop
Top achievements
Rank 1
Veteran
Swaroop asked on 21 Oct 2020, 04:40 PM

Hello,

Ive built a Winforms RadForms application with VB.Net. The application contains several forms that contains several rad controls. The form contains several buttons when clicked changes the theme. But it takes around 3-4 seconds for the theme to change. Now what I want to achieve is the application must show a message box with the message- "Theme Changed" when the theme has changed. I was wondering if there are any events that can be fired during a theme change and found one event named "ThemeNameChanged".  I set it up like this:

Private Sub (source as Object, args As ThemeNameCahngedEventArgs) Handles Me.ThemeNameChanged

Msgbox("Theme Changed")

EnsSub

Then I switch the theme with the click of a button:

 

Private sub Button1_Click(...) Handles Button1.Click

ThemeResolutionService.ApplicationThemeName = "TelerikMetroBlue"

End Sub

But when click Button1 the theme changes but the message is not displayed once the theme has changed. So How Do I dsiplay a message when the theme has changed?

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 26 Oct 2020, 09:35 AM

Hello, Swaroop, 

Setting the ThemeResolutionService.ApplicationThemeName property will style the entire application with the newly applied theme. However, in order to detect the theme changing in this case the ThemeResolutionService offers the ApplicationThemeChanged event:

I have attached my sample project for your reference.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
Swaroop
Top achievements
Rank 1
Veteran
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or