Delphi 10.4 - Per-Control styles in VCL by Radek Červinka

FireWind

Свой
Регистрация
2 Дек 2005
Сообщения
1,957
Реакции
1,199
Credits
4,009
Delphi 10.4 - Per-Control styles in VCL
Radek Červinka June 10, 2020

[SHOWTOGROUPS=4,20]
Delphi 10.4 - Per-Control styles in VCL
Radek Červinka June 10, 2020


In the new version, it is possible to specify different styles in the VCL for individual visual components. Previously, it was possible to apply a style to the entire application.

Each visual component has a StyleName property , where the style name is written as text.

style


The style must be loaded in the application (either at runtime or as a default style via Project Options - it is then loaded in dpr).

style




By the way, please note that the styles are high-dpi. Not all of them, but some more are available through GetIt.

style


Here it is clear that one button and ListView has a style, the other uses the default windows style.

If, on the other hand, you have the whole stylized application and you want to "remove" an element from the style, set the Windows style to it.

If you want to style dialogs, set TStyleManager.DialogsStyleName . Another interesting option is TStyleManager.UseSystemStyleAsDefault , where you say that the default style is Windows and you will style only some forms.

Of course, all this only applies if you enable styles in the application.
[/SHOWTOGROUPS]