Controls
Once a theme is applied, the UI settings (mainly font color
and background color) of controls in the theme file have the
highest priority; and the border (whether and what color to
display) varies from different controls.
What can be set by the
theme
Background color and font color:
-
The background color and the text font color of controls
in the theme file have the highest priority. -
The background of the following control is set to
transparent by default in the theme file: GroupBox,
StaticText, and StaticHyperLink. If you want to set the
background color of them, you should first set
“background-transparent” to false in the theme file.
Border:
-
If the control has a border, then the border style is
always StyleBox!, no matter if you have set to StyleBox!,
StyleLowered!, StyleRaised!, or StyleShadowBox in the
painter. -
If the control has a border, then the border color in
the theme file has the highest priority. -
The following control always has a border regardless
whether Border is selected in the painter: DatePicker,
DropDownListBox, and DropDownPictureListBox. And you can set
their border color in the theme file. -
The following control always has a border although there
is no Border property in the painter or the theme file:
CommandButton, PictureButton, and GroupBox. And you can set
their border color in the theme file. -
Whether the following control has a border is determined
by the Border setting in the painter: WebBrowser, InkEdit,
InkPicture, SingleLineEdit, EditMask, MultiLineEdit,
RichTextEdit, ListBox, PictureListBox, ListView, TreeView,
Graph, and MonthCalendar. Dynamically setting the border
property at runtime in the script has no effect. -
The following control has no border by default
(“border”=0 in the theme file): StaticText and
StaticHyperLink. If you set “border”=1 in the theme file, then
the border settings in the painter determine whether and what
color to display the border.
RibbonBar:
-
The background color, border color, font color of the
RibbonBar control and ribbon item controls can be set in the
theme file.
What cannot be set by the
theme
-
The theme is not effective to Line, Oval, Rectangle,
RoundRectangle, Picture, PictureHyperLink, and
Animation. -
The theme is not effective to the OLE control or ActiveX
control. -
RichTextEdit control is a third-party ActiveX control,
so only the border of this control is configurable in the
theme file. -
The background color for the following controls is
transparent: CheckBox and RadioButton; it cannot be changed in
the painter or the theme file. But when they are placed on top
of an unsupported control (such as Picture), their background
color will not be transparent and can be set in the
painter. -
The lines that connect the tree items in the TreeView
control will not display, even though the HasLines property is
enabled. -
The font related properties (except font color) cannot
be set by the theme file. -
The ListView Header cannot be set by the theme
file.
Workarounds
Take StaticText as an example. If a theme is applied, the
font color and background color of StaticText can only be set in
the theme file, and cannot be dynamically changed by the
expression or the Modify method. If you want to set different font
color or background color for multiple StaticText controls, you
will have to disable the UI Theme for this control first. To
disable the UI Theme for the StaticText control, change the value
of “drawing” to false under “statictext” in the theme file.