zoukankan      html  css  js  c++  java
  • delphi 通过TStyleManager设置主题类型

    引入

    Vcl.Themes,
    Vcl.Styles,

    设置主题类型

    TStyleManager.TrySetStyle('Turquoise Gray');

    或则在窗体代码中实现

    unit Unit14;

    interface

    uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
    Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Themes,
    Vcl.Styles;

    type
    TForm14 = class(TForm)
      btn1: TButton;
      btn2: TButton;
      lst1: TListBox;
      OpenDialog1: TOpenDialog;
      procedure FormCreate(Sender: TObject);
      procedure btn1Click(Sender: TObject);
    private
      { Private declarations }
      procedure StylesListRefresh();
    public
      { Public declarations }
    end;

    var
      Form14: TForm14;

    implementation

    {$R *.dfm}

    { TForm14 }

    procedure TForm14.btn1Click(Sender: TObject);
    begin
      TStyleManager.SetStyle(lst1.Items[lst1.ItemIndex]);
    end;

    procedure TForm14.FormCreate(Sender: TObject);
    begin
      Self.StylesListRefresh;
    end;

    procedure TForm14.StylesListRefresh;
    var
      stylename: string;
    begin
      Self.lst1.Clear;
      // retrieve all the styles linked in the executable
      for stylename in TStyleManager.StyleNames do
      begin
        lst1.Items.Add(stylename);
      end;
    end;

    end.

  • 相关阅读:
    【BZOJ2329】括号修复(splay)
    连接数据库
    文件锁
    带进度条的输入流
    文件对话框
    使用Scanner来解析文件
    IO流(数据流
    IO流(随机流,数组内存流
    IO流文件字符输入输出流,缓冲流
    IO流(文件字节输入输出
  • 原文地址:https://www.cnblogs.com/yangxuming/p/7346269.html
Copyright © 2011-2022 走看看