Question

In my programming team we all use Delphi XE2 Professional. We just figured out that on different computers different numbers of VCL styles are available.

Where do VCL styles come from? Do I have to take care to move styles from one Delphi installation to another?

Was it helpful?

Solution

Q : Where do VCL styles come from?

A : The Vcl Styles files are part of the Delphi XE2 and XE3 versions, and are installed in two locations C:\Users\Public\Public Documents\RAD Studio\<n.n>\Styles and C:\Program Files (x86)\Embarcadero\RAD Studio\<n.n>\Redist\styles\vcl folders.

Also you the Vcl Styles files can be created from the scratch or customized, so maybe some of the machines contains custom Vcl Styles and that explain the different numbers of vsf files.

Q : Do I have to take care to move styles from one Delphi installation to another?

That's depends of how the Vcl Styles are added to the Delphi project. Basically exist 3 ways of add the Vcl styles to your project.

  1. Using the Projects->Options->Application->Appearance Menu option. In this case a new entry by each style is added to the .dproj (Delphi project file) with the path to the style. After when you compile you project the styles referenced by the .dproj file are embedded as a resource.

  2. Loading the styles manually (from a external file or resource) using the TStyleManager class.

  3. Editing directly the .dproj file and adding a new entry called VCL_Custom_Styles in the <PropertyGroup Condition="'$(Base)'!=''"> Key.

So if you Delphi project is referencing the Vcl styles using the method 1 or 3, you will need copy the Vcl Styles between machines to avoid compilations problems if a Vcl style is missing.

Note : As recommendation you can create a style folder (and add that folder as part of you source control scheme) in your Delphi project location and here copy the vcl styles used by you Application, and then modify your code to load the styles using the method 2.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top