Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
Delphi

Adding a custom style selector to your VCL application

the future of starts demands massive productivity

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   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

About author

Director of Product Management, Developer Tools Idera, Inc.

Leave a Reply

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

IN THE ARTICLES