VCL从RES中读取皮肤

将皮肤文件添加到Resources中,resourcetype必须设置为VCLSTYLE,在工程文件中添加vcl.themes,vcl.styles两个单元就可以在程序启用时直接从资源文件中读取皮肤文件

var

lvstyle: TStyleManager.TStyleServicesHandle;

begin

try

// TStyleManager.SetStyle(TStyleManager.LoadFromFile('TabletLight.vsf'));

// DONE -c Task:正式发布时把皮肤编译进res文件当中 2017.12.07

lvstyle := TStyleManager.LoadFromResource(HInstance, 'skinTableLight');

if lvstyle <> nil then

TStyleManager.SetStyle(lvstyle);

except

 

end;

end;

原文地址:https://www.cnblogs.com/jspdelphi/p/8623990.html