How can I set the default system style in Delphi 10 Seattle?

孤者浪人 提交于 2019-12-24 11:55:24

问题


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

回答1:


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


来源:https://stackoverflow.com/questions/32507249/how-can-i-set-the-default-system-style-in-delphi-10-seattle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!