-
Notifications
You must be signed in to change notification settings - Fork 114
VclStylesPreview
Rodrigo Ruz edited this page Mar 27, 2019
·
3 revisions
The TVclStylesPreview Component included in the Vcl.Styles.Ext unit allow you preview a VCL Style from a file or resource.
Check the next sample code
var
StyleName: string;
SourceInfo: TSourceInfo;
LStyle: TCustomStyleServices;
FPreview: TVclStylesPreview;
begin
FPreview := TVclStylesPreview.Create(Self);
FPreview.Parent := PanelPreview;
FPreview.BoundsRect := PanelPreview.ClientRect;
StyleName := 'Carbon';
if (StyleName <>'') and (not SameText(StyleName, 'Windows')) then
begin
TStyleManager.StyleNames;//call DiscoverStyleResources
LStyle := TStyleManager.Style[StyleName];
FPreview.Caption := StyleName;
FPreview.Style := LStyle;
TVclStylesPreviewClass(FPreview).Paint;
end;
....
end;
Check out a sample application here.