看看 Delphi XE2 为 VCL 提供的 14 种样式

其实只提供了 13 个 vsf 样式文件, 还有默认的 Windows 样式, 共 14 种.

在空白窗体上添加 ListBox1 等控件, 测试代码:


uses IOUtils, Vcl.Styles, vcl.Themes;

procedure TForm1.FormCreate(Sender: TObject);
var
  dir, fileName, styleName: string;
begin
  //VCL 的样式文件 *.vsf 在 X:Program FilesEmbarcaderoRAD Studio9.0Rediststylesvcl
  dir := GetEnvironmentVariable('Delphi') + 'Rediststylesvcl';

  {载入所有 *.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;


效果图:

https://www.cnblogs.com/del/archive/2011/11/09/2243556.html

Delphi XE2 新功能试用:多种皮肤样式静、动态设置方法

Delphi XE2 新功能试用:多种皮肤样式静、动态设置方法

静态方式:

1、新建VCL Forms Application;

2、打开菜单Project - Application - Appearance;

3、在Custom Styles中可选择所有默认带的皮肤样式;

4、设置Default style后,启动软件后便以默认的样式显示界面。

 

动态方式:

1、完成静态方式的1-3步;

2、引用Vcl.Themes;

3、使用方法TStyleManager.SetStyle('Aqua Light Slate'),参数为样式的名称。

https://www.cnblogs.com/rogge7/p/5586299.html

原文地址:https://www.cnblogs.com/chinasoft/p/14111745.html