Learn Useful Hints For Working With Styles To Build Visually Stunning Windows Applications
Want to style your Delphi/C++Builder applications with few steps? Want to view and choose your style before applying to your application? Don’t know how to do? This post will guide you. A style is a set of graphical details that define the look and feel of a VCL/FMX application. Similar to a theme in Windows. A style permits you to change the appearance of every part and state of a control.
Where are the styles on your computer? C:UsersPublicDocumentsEmbarcaderoStudio21.0Styles. Plenty of styles available under this folder, you can choose from here.
Where can you get other styles from? Use Tools -> Get it Manager -> Styles -> Select one among them and install. After installing these styles can be found under this folder C:UsersPublicDocumentsEmbarcaderoStudio21.0Styles With folder names per platform like -> Android, iOS, macOS, Linux, and Win. Other these styles, we can get some third party Styles from DelphiStyles
How to view your styles? Navigate to his folder, C:Program Files (x86)EmbarcaderoStudio21.0binVCLStyleViewer.exe and pass the parameter with the Style name with path. Similarly for FMX Styles use FMXStyleViewer.exe. Alternatively, you can open the style files, by right click-> open with ->Navigate to VCLStyleViewer.exe or FMXStyeViewer Accordingly.
How to convert VCL-Styles to FMX- Styles? Open IDE->Tools->Bitmap Style Designer and open the existing VCL styles and then Save the file as FMX style with Option Save as type value “FireMonkey Style”
How do I assign a style to the program? Place a TStyleBook component to the form. Double Click and open the style file from the location mentioned above. Save and close the Style Designer. Assign the Stylebook reference to Form StyleBook Property. Use TStyleBook.UseStyleManager property checked when more than one form created from the main form where StyleBook property is assigned. Note: For Dialogs in FMX the styles are not applied, we need to create custom dialogs.
How do I assign a style per platform? On Double-clicking the TStyleBook -> Style designer contains the option Platform where you can choose your platforms. How to set styles for multi-platform in a single application? You can use style manager to set the styles at runtime, but we need to take care of checking the platform, and deployment as well. A Simple solution is to use different data modules for each platform and place TStyleBook in each platform, instantiate according to the platform.
Check this full video of useful hints for working with styles.