我想用Delphi XE中自带的皮肤控件TdxSkinController,但是属性栏中不知道用哪个属性加载皮肤,还有不知道怎么引用皮肤,请问有谁用过这个控件?请问怎么用?有例子也可以,谢谢了!!!

解决方案 »

  1.   

    首先更正一下 TdxSkinController 不是delphi xe自带的控件,它是DevExpress套件当中的皮肤组件。给你写一个例子!代码如下:unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, ComCtrls, cxLookAndFeels, dxSkinsForm,
      StdCtrls,dxSkinsCore,cxLookAndFeelPainters,  //加入所支持的皮肤
      dxSkinBlack,dxSkinBlue,dxSkinCaramel,dxSkinOffice2007Blue,
      dxSkinOffice2007Green, dxSkinMcSkin,dxSkinLilian,dxSkinCoffee;type
      TForm1 = class(TForm)
        dxSkinController1: TdxSkinController;
        ListBox1: TListBox;
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
        procedure ListBox1DblClick(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    var
      i:Integer;
    begin
      //列举当前程序所支持的皮肤
      for i:=0 to GetExtendedStylePainters.Count -1 do
         ListBox1.Items.Add(GetExtendedStylePainters.Names[i]);
    end;procedure TForm1.ListBox1DblClick(Sender: TObject);
    begin
      //切换皮肤
      if ListBox1.ItemIndex =  -1 then Exit;
      dxSkinController1.UseSkins := False;
      dxSkinController1.SkinName := ListBox1.Items[ListBox1.ItemIndex];
      dxSkinController1.UseSkins := True;
    end;end.
      

  2.   

    http://download.csdn.net/detail/lsh341999/3042740
    看看这个吧,而且还是外部加载的
      

  3.   

    //加入所支持的皮肤
      dxSkinBlack,dxSkinBlue,dxSkinCaramel,dxSkinOffice2007Blue,
      dxSkinOffice2007Green, dxSkinMcSkin,dxSkinLilian,dxSkinCoffee;
    请问,这个怎么加的,不明白
      

  4.   

    晕不死的。我用d7仿造了上面的程序。结果没动静。编译时能通过。点button1也能列出皮肤名称。双击listbox1就没动静。这是什么问题?
      

  5.   

    查出来了。代码少了一局:
    procedure TForm1.ListBox1DblClick(Sender: TObject);
    begin
      //切换皮肤
      if ListBox1.ItemIndex =  -1 then Exit;
      dxSkinController1.UseSkins := False;
      dxSkinController1.SkinName := ListBox1.Items[ListBox1.ItemIndex];
    //  Showmessage(ListBox1.Items[ListBox1.ItemIndex]);
    //  dxSkinController1.SkinName := ListBox1.Items[].Strings;
      dxSkinController1.NativeStyle := false;
      dxSkinController1.UseSkins := True;end;
    需要dxSkinController1.NativeStyle := false;
    就可以了。