Disable a style in VCL application
- by Martin
I am adding the a VCL style into my application but am also giving the users an option to turn this off but I cannot figure out how to do this globally at runtime.
Setting "TStyleManager.AutoDiscoverStyleResources := false" almost works but it pops up with an error message saying "Style {style set} not found" but after dismissing the message does exactly what I want.
This code I would expect to work but does not...
if (not ParamObj.UseDarkStyle) then
begin
//TStyleManager.AutoDiscoverStyleResources := false;
TStyleManager.SetStyle(TStyleManager.SystemStyle);
end;
I also tried (originally)
TStyleManager.TrySetStyle('Windows');
but this also does not work.
I have tried this both sides of "Application.Initialize;" with no difference
What am I missing?
Thanks in advance,
Martin