RAD Studio 10.4.1 is now available! Learn more. Looking for discounts? Visit our Special Offers page!
Delphi

Adding a custom style selector to your VCL application

Adding a style selector menu to your application only takes a couple of lines of code and allows you to quickly update your existing user interface while providing added flexibility to your customers.

To add a style selector, I added a combobox to the form with the following code:

uses VCL.Themes;

procedure TForm9.StyleSelectorChange(Sender: TObject);
begin
  TStyleManager.SetStyle(StyleSelector.Text);
end;

procedure TForm9.FormCreate(Sender: TObject);
var
  StyleName: string;
begin
  for StyleName in TStyleManager.StyleNames do
    StyleSelector.Items.Add(StyleName);
  StyleSelector.ItemIndex := StyleSelector.Items.IndexOf(TStyleManager.ActiveStyle.Name);
end;
end.

 
The combo box will display the styles you’ve selected via Project > Options > Application > Appearance.

 

In this post, I am highlighting some of our Windows 10 styles that are included in 10.2 Tokyo, along with custom styles from DelphiStyles.com

To use custom styles, you will need to move the .vsf files into the following folder:

C:Users\Public\Documents\Embarcadero\Studio\19.0\Styles 

Shown: Windows 10 Green VCL style, included in 10.2 Tokyo

 

Shown: Windows 10 Slate Gray VCL style, included in 10.2 Tokyo

 

Shown: Madison Dark VCL style, available at DelphiStyles.com

 

Shown: Oxford Blue VCL style, available at DelphiStyles.com

 

Shown: Material White VCL style, available at DelphiStyles.com

 

[DownloadButton Product=’Delphi’ Caption=’Download a RAD Studio 10.2 Trial Today!’]


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Learn More About Upgrading

About author

Director of Product Management, Developer Tools Idera, Inc.
Related posts
C++DelphiTech Partner

Easily Download And Install A Robust Syntax Highlighter For Delphi And C++ Builder From GetIt

C++Delphi

Powerful Set Of 200+ VCL Components By DevExpress For Delphi Business Solutions

C++CodeIDERAD Studio

C++ Builder 10.4.x Platform APIs

C++DelphiRAD Studio

Automate Excel and Word Directly From Delphi Using Office Component Suite

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES