首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

delphi xe3更替皮肤档

2013-10-23 
delphi xe3更换皮肤档以前在撰写程序时,最讨厌的就是丑丑的外观,如果不是自己画,就是得找第三方组件(像Bus

delphi xe3更换皮肤档
以前在撰写程序时,最讨厌的就是丑丑的外观,如果不是自己画,就是得找第三方组件(像BusinessSkinForm)来解决。
自从Delphi XE2就开始有的功能,跟大家分享一下如何让程序看起来不再这么丑。
1.静态更改
.Project→Options开启Project Options选项,在Application→Appearance的Custom Styles就是可以更改接口的选项
.如果不清楚长什么样子时,可以点选任一名称反白后,再点旁边的Preview就可以预览
.勾选要变成的Style后,再到Default Style下拉你要的Style按OK即可。 
2.动态程序更改
.依照静态更改方式,勾选你想要呈现的STYLE。
.增加 uses Vcl.Themes
.读入风格档
procedure TForm1.Button1Click(Sender: TObject);
Var
 StyleName  : string;
begin
  ListBox1.Items.Clear;
  for StyleName in TStyleManager.StyleNames do
    if ListBox1.Items.IndexOf(Name)=-1 then
      ListBox1.Items.Add(StyleName);
end;
.设定风格档
procedure TForm1.Button2Click(Sender: TObject);
begin
  if ListBox1.ItemIndex>=0 then
    TStyleManager.SetStyle(ListBox1.Items[ListBox1.ItemIndex]);;
end;
 
范例程序下载 GitHub https://github.com/superlevin/DelphiXE3_SetStyle
3.自制风格.Tools→Bitmap Style Designer 
预设的Style档案位置在:C:\Users\Public\Documents\RAD Studio\10.0\Styles

作者: 林寿山
博客: http://superlevin.ifengyuan.tw/
电邮: superlevin@gmail.com
QQ号: 862477878 

热点排行