1

I am trying to port some code that works in Delphi XE8 to Delphi 10 Seattle.

This code sets the default system style of my program, but the SetSystemStyle method does not exist in the Delphi 10 Seattle.

TStyleManager.SetSystemStyle(Self);
David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • Sorry, I was looking in the wrong place. That method has been removed. I've no idea how to adapt your code. It will be something like `TStyleManager.SetStyle(xxx.GetSystemStyle(yyy))` but I don't know where to get the `xxx` and `yyy`. Look for use of `IStyleBehavior` in the source code. As usual there's no documentation. Embarcadero will do that in a couple of years time. – David Heffernan Sep 11 '15 at 16:48
  • From [this source](https://forums.embarcadero.com/thread.jspa?threadID=117396&tstart=1) - "_check the box title **Enable Runtime Themes** in the **Manifest File** panel of the **Project Options**._" – Alexander Sorokin Sep 11 '15 at 16:59
  • @Alexander No, that's for Windows VCL apps – David Heffernan Sep 11 '15 at 22:00

1 Answers1

3

I added the Default_Style_Block_Pointer: TMemoryStream; to the MainForm Var: block

I placed this code in the MainForm.OnCreate event:

Default_Style_Block_Pointer:=TMemoryStream.Create;
  TStyleStreaming.SaveToStream(TStyleManager.ActiveStyle(Self),Default_Style_Block_Pointer,TStyleFormat.Binary);

I am using this code to restore the default style:

     Default_Style_Block_Pointer.Position:=0; 
        TStyleManager.SetStyle(TStyleStreaming.LoadFromStream(Default_Style_Block_Pointer));