Zoltan Karpati
Zoltan Karpati

Reputation: 184

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

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

Upvotes: 1

Views: 997

Answers (1)

Zoltan Karpati
Zoltan Karpati

Reputation: 184

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

Upvotes: 3

Related Questions