Where do VCL styles come from?

江枫思渺然 提交于 2019-12-14 03:53:26

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/15005327/where-do-vcl-styles-come-from

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!