zoukankan      html  css  js  c++  java
  • dxSkinController动态调入皮肤

    dxSkinController可以在运行时动态调入皮肤,不用在设计期Use一大串文件,把要用的皮肤用安装程序自带的Skin Editor编辑一个SkinRes文件,然后在程序中动态调入就可以了。

    uses dxSkinsDefaultPainters;

    procedure TForm1.FormCreate(Sender: TObject);
    begin
    cxComboBox1.Properties.Items.Clear;
    dxSkinsUserSkinPopulateSkinNames(ExtractFilePath(ParamStr(0))+'sSkins.skinres',
    cxComboBox1.Properties.Items);
    cxComboBox1.ItemIndex:=0;
    end;

    procedure TForm1.cxComboBox1PropertiesChange(Sender: TObject);
    begin
    //这个地方必须是UserSkin,不然不会起作用
    dxSkinController1.SkinName:='UserSkin';
    dxSkinsUserSkinLoadFromFile(ExtractFilePath(ParamStr(0))+'sSkins.skinres',cxComboBox1.EditText);
    end;

    procedure TForm1.dxSkinController1SkinForm(Sender: TObject;
    AForm: TCustomForm; var ASkinName: String; var UseSkin: Boolean);
    begin
    //Simon自己认为这一句不应该要,要了窗口就不能跟着变,而且dxSkinController要在所有cx控件添加前添加,否则控件皮肤不受拜你控制。
    UseSkin:=false;
    end;
     
    Simon补充:
      在Developer Express.VCL的安装目录下,文件夹Developer Express.VCLExpressSkins LibraryBinary Skin Files 中包含有Developer Express 自带的控件皮肤资源包,可以把全部皮肤资源包“AllSkins.skinres”Copy 到工程文件目录中,以进行调用,
     
      但有一个问题现在还不知道,就是dxBarPopuMenu的皮肤怎么受控制的?现在研究中!

    其他一些控件要手动添加***Painter类,都在ExpressSkins LibrarySources包里,如dxSkinsdxStatusBarPainter等等.否则SKIN就会显示不出来
  • 相关阅读:
    Web 存储之localStorage
    webpack之font-awesome
    vue-cli快速构建vue项目
    npm与cnpm混用导致的问题
    错误:linker command failed with exit code 1 (use -v to see invocation)
    mac 显示隐藏文件
    iOS 不要使用tag传递TableViewCell的indexPath值
    iOS background location
    github+hexo 搭建个站
    iOS CoreBluetooth
  • 原文地址:https://www.cnblogs.com/Values/p/3591472.html
Copyright © 2011-2022 走看看