uses IOUtils, Vcl.Styles, vcl.Themes;procedure TForm1.FormCreate(Sender: TObject);var dir, fileName, styleName: string;begin //VCL 的样式文件 *.vsf 在 X:\Program Files\Embarcadero\RAD Studio\9.0\Redist\styles\vcl\ dir := GetEnvironmentVariable('Delphi') + '\Redist\styles\vcl'; {载入所有 *.vsf 文件} for fileName in TDirectory.GetFiles(dir, '*.vsf') do TStyleManager.LoadFromFile(fileName); {将样式名称导入列表} for styleName in TStyleManager.StyleNames do ListBox1.Items.Add(styleName);end;{修改样式}procedure TForm1.ListBox1Click(Sender: TObject);begin TStyleManager.SetStyle(ListBox1.Items[ListBox1.ItemIndex]);end;
效果图: