Hi,
is there any event that I can use to detect when a skin or style is changed? I have some static Color properties that the application use to paint some custom controls and I initialize them with the current skin like this
BackColorReadOnly = CurrentSkin.TranslateColor(SystemColors.InactiveBorder);
and I'd need that event to refresh them.
Thanks in advance,
Giovanni Tresoldi
Hi Giovanni,
Yes, there is such an event. An application wide style is controlled by the UserLookAndFeel.Default class. Handle its StyleChanged event to react to the style changing. You can handle this event in the Program class before the Application.Run method call.
UserLookAndFeel.Default.StyleChanged += new EventHandler(Default_StyleChanged);
Thanks,
Ted
Thank you very much!
Hi Ted. in 20.1 this mechanism is now obsolete.
What is the correct way to catch skin change events in 20.1?
Kind Regards, Garry.
Hi,
It seems that your current question and another one you posted in The UserLookAndFeel.Default.StyleChanged event is not raised if a palette is changed relate to the same thing. That is why I created a separate ticket on your behalf. We will answer you there shortly.
P.S. We kindly ask you to create a new thread (How to catch the moment when a skin or palette is changed) for each theme you need our assistance with in the future.