TdxSkinChooserGalleryItem.OnSkinChanged Event
Enables you to respond to clicks on gallery items.
Declaration
property OnSkinChanged: TdxSkinChooserGallerySkinChangedEvent read; write;
Remarks
Sender
provides access to the gallery whose item is clicked.
ASkinName
returns the caption of the clicked gallery item.
Clicking a gallery item selects it. As a result, the gallery’s SelectedSkinName property is updated with the caption of the clicked gallery item, and this fires the OnSkinChanged event. You can handle it to apply a skin associated with the clicked gallery item to look and feel settings.
Code Example
The following example demonstrates how to handle the OnSkinChanged
event to change the root look and feel and the Ribbon color scheme based on the selected skin chooser gallery item.
procedure TMyForm.dxSkinChooserGalleryItem1SkinChanged(Sender: TObject; const ASkinName: string);
begin
SetSkin(dxSkinChooserGalleryItem1.SelectedGroupItem);
end;
procedure TMyForm.SetSkin(ASkinItem: TdxSkinChooserGalleryGroupItem);
begin
// Applies the selected skin or look & feel style to the root look & feel
ASkinItem.ApplyToRootLookAndFeel;
// Applies the selected skin or look & feel style to the Ribbon control
if ASkinItem.LookAndFeelStyle = lfsSkin then
dxRibbon1.ColorSchemeName := ASkinItem.SkinName
else
case dxRibbon1.Style of
rs2007, rs2010: dxRibbon1.ColorSchemeName := 'Blue';
rs2013: dxRibbon1.ColorSchemeName := 'White';
rs2019, rs2016, rs2016Tablet: dxRibbon1.ColorSchemeName := 'Colorful';
end;
end;
See Also