unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, cxStyles, dxSkinscxPCPainter, cxCustomData, cxFilter, cxData, cxDataStorage, cxEdit, cxNavigator, cxGridCustomTableView, cxGridTableView, cxGridCustomView, cxClasses, cxGridLevel, cxGrid, Vcl.Menus, cxContainer, cxTextEdit, cxButtons, Vcl.StdCtrls, dxSkinsForm, cxMaskEdit, cxDropDownEdit; type TForm1 = class(TForm) cxGrid1Level1: TcxGridLevel; cxGrid1: TcxGrid; view: TcxGridTableView; viewColumn1: TcxGridColumn; viewColumn2: TcxGridColumn; viewColumn3: TcxGridColumn; viewColumn4: TcxGridColumn; cxStyleRepository1: TcxStyleRepository; cxStyle1: TcxStyle; dxSkinController1: TdxSkinController; lst1: TListBox; cxComboBox1: TcxComboBox; procedure btn1Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure cxComboBox1PropertiesChange(Sender: TObject); procedure lst1DblClick(Sender: TObject); procedure lst1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.btn1Click(Sender: TObject); var i:Integer; begin end; procedure TForm1.cxComboBox1PropertiesChange(Sender: TObject); begin // 这个地方必须是UserSkin,不然不会起作用 dxSkinController1.SkinName := 'UserSkin'; dxSkinsUserSkinLoadFromFile('f:AllSkins.skinres', cxComboBox1.EditText); end; procedure TForm1.lst1Click(Sender: TObject); begin // 这个地方必须是UserSkin,不然不会起作用 dxSkinController1.SkinName := 'UserSkin'; dxSkinsUserSkinLoadFromFile('f:AllSkins.skinres', lst1.Items[lst1.ItemIndex]); end; procedure TForm1.lst1DblClick(Sender: TObject); begin // 这个地方必须是UserSkin,不然不会起作用 // dxSkinController1.SkinName := 'UserSkin'; // dxSkinsUserSkinLoadFromFile('f:AllSkins.skinres', lst1.Items[lst1.ItemIndex]); end; procedure TForm1.FormCreate(Sender: TObject); begin //设置其SkinName属性为UserSkin,NativeStyle=False,UseSkins=True; cxComboBox1.Properties.Items.Clear; dxSkinsUserSkinPopulateSkinNames('f:AllSkins.skinres',cxComboBox1.Properties.Items); cxComboBox1.ItemIndex := 0; dxSkinsUserSkinPopulateSkinNames('f:AllSkins.skinres',lst1.Items); lst1.ItemIndex:= 0; // dxSkinController1.SkinName:= 'UseSkin'; dxSkinController1.UseSkins:= True; dxSkinController1.NativeStyle:= False; end; end.