SetControlColors
This reference collection includes Vector documentation reproduced with permission. Snippets may require configuration-specific symbols and are not all standalone programs. Sources and validation limits.
Syntax
void SetControlColors(char[] panel, char[] control, long backcolor, long textcolor);
Function
Sets the background and text color of panel elements. The panel is accessed by its individual panel name that is entered in thePanel Designer.
Parameters
panel Panel name, restricted to 128 characters."" – references allloaded panelsIf you open a panel the first time, the panel is loaded.
If you close the panel, it remains loaded.
control
- Symbol assignment is not case sensitive.
- If you want to access all elements of a panel the notation "" is used, see example below.
backcolor
Color value (e.g. calculated by MakeRGB)
textcolor
Color value (e.g. calculated by MakeRGB)
Return Values
—
// Choose the scope you intend to change; these are alternatives.
SetControlColors("motor", "PedalPos", MakeRGB(255, 0, 0), MakeRGB(0, 0, 255));
// All controls in one panel.
SetControlColors("motor", "", MakeRGB(255, 0, 0), MakeRGB(0, 0, 255));
// All controls in all panels.
SetControlColors("", "", MakeRGB(255, 0, 0), MakeRGB(0, 0, 255));
Related reference: SetControlProperty | SetControlForeColor | SetControlBackColor | SetDefaultControlColors