Poser un dxSkinController sur le DataModule, virer le NativeStyle, choisir une skin.
Dériver la fiche principale de TdxRibbonForm (use dxRibbonForm
)
Poser un dxRibbon
SupportNonClientDrawing = true
Sur le OnSkinChanged du dxRibbonSkinChooser :
procedure TFMain.dxSkinChooserGalleryItem1SkinChanged(Sender: TObject;
const ASkinName: string);
begin
DM.dxSkinController1.NativeStyle := False;
DM.dxSkinController1.SkinName := ASkinName;
dxSkinChooserGalleryItem1.LargeGlyph := dxSkinChooserGalleryItem1.SelectedGroupItem.Glyph;
//must set ColorSchemeName separately
//see http://www.devexpress.com/Support/Center/p/S20045.aspx
dxRibbon1.ColorSchemeName := ASkinName;
with TRegistry.Create do
Try
if OpenKey('\Software\Cat\ProgName',True) then Begin
WriteString('SkinName',ASkinName);
CloseKey;
end;
finally
Free;
end;
end;
Et dans le Main.OnFormShow :
with TRegistry.Create do
Try
if OpenKey('\Software\Cat\Progname',False) then Begin
DM.dxSkinController1.SkinName:=ReadString('SkinName');
dxRibbon1.ColorSchemeName := DM.dxSkinController1.SkinName;
CloseKey;
end;
finally
Free;
end;