TdxSkinController使用 我想用Delphi XE中自带的皮肤控件TdxSkinController,但是属性栏中不知道用哪个属性加载皮肤,还有不知道怎么引用皮肤,请问有谁用过这个控件?请问怎么用?有例子也可以,谢谢了!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 首先更正一下 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. http://download.csdn.net/detail/lsh341999/3042740看看这个吧,而且还是外部加载的 //加入所支持的皮肤 dxSkinBlack,dxSkinBlue,dxSkinCaramel,dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinMcSkin,dxSkinLilian,dxSkinCoffee;请问,这个怎么加的,不明白 晕不死的。我用d7仿造了上面的程序。结果没动静。编译时能通过。点button1也能列出皮肤名称。双击listbox1就没动静。这是什么问题? 查出来了。代码少了一局: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;就可以了。 嵌入汇编高手 如何解决treeview中结点的移动问题. 如何进行时间相减 如何得到TDBGrid中某一格或者某一列的数据? 怎样判断按下了Enter键。 关于DBNavigator的疑问,请各位大虾帮忙。 无条件送您50元,人人有份! delphi 调用webservice 的问题 李维的电子商务篇的第二章的例子没法运行,这是为何? form的查询问题!简单得很,四十分,值! 如何给分配的内存赋值? IdFtp 没有 RecvBufferSize 属性
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.
看看这个吧,而且还是外部加载的
dxSkinBlack,dxSkinBlue,dxSkinCaramel,dxSkinOffice2007Blue,
dxSkinOffice2007Green, dxSkinMcSkin,dxSkinLilian,dxSkinCoffee;
请问,这个怎么加的,不明白
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;
就可以了。