Delphi XE中的主题应用程序 [英] Theme-ing applications in Delphi XE
问题描述
有人知道是否可以将自定义主题应用于Delphi应用程序。例如,一次更改整个应用程序(即一组表单)的默认颜色,字体,标签样式等。
Does anyone know if it is possible to apply custom themes to Delphi applications. Example, changing the default colour, font, tab styles, etc. of a whole application (i.e. set of forms) at once. Kind of like css files for webpages.
推荐答案
更改大多数vcl控件的颜色和字体相对容易,您可以遍历表单的所有控件,然后为每个控件设置属性 Font
和 Color
。现在,要自定义VCL控件的图形,您必须所有者图形每个控件都可以自我。另一种方法是使用外观库为您完成此操作,例如,尝试 VCLSkin
组件,使您可以对整个应用程序进行外观设置,而无需在VCL控件中进行修改。顺便说一句,Delphi(XE2)的新传入版本在此领域进行了重大更改,引入了 FireMonkey 和 VCL样式。
Change the color and font of most of the vcl controls is relative easy to do, you can iterate over all the controls of a form and then set the propertiesFont
and Color
for each control. Now to customize the drawing of a VCL control you must owner draw each control your self. Another way is using a skinning library which do this for you, for example try the VCLSkin
component which let you skin the entire application with no need for modifications in your VCL controls. Btw the new incoming version of Delphi (XE2) has great changes in this area introducing FireMonkey and VCL Styles.
这篇关于Delphi XE中的主题应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!