码迷,mamicode.com
首页 > Windows程序 > 详细

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

时间:2020-12-15 12:35:34      阅读:4      评论:0      收藏:0      [点我收藏+]

标签:www   dir   修改   delphi   样式   mfile   strong   显示   rgb   

其实只提供了 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 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;


效果图:

技术图片

 

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

 

 

 

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

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

标签:www   dir   修改   delphi   样式   mfile   strong   显示   rgb   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!