CAPL Script

SetControlBackColor

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 SetControlBackColor(char[] panel, char[] control, long color);

Function

Sets the background color of panel elements. The panel is accessed by its individual panel name that is entered in thePanel Designer/Panel Editor.

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.

color

Color value (e.g. calculated by MakeRGB)

Return Values

—

Reference example from the CANoe 12 help. Check the required configuration, database objects and API availability in your installed version; this is not a recorded compiler or runtime test. The following blocks are separate fragments or alternatives, not one combined program.

// Set the background color for a specific control of a panel
SetControlBackColor("motor", "PedalPos", MakeRGB(255,0,0));
// All controls of the panel are set to the same background color
SetControlBackColor("motor", "", MakeRGB(255,0,0));
// All controls of all panels are set to the same background color
SetControlBackColor("", "", MakeRGB(255,0,0));

SetControlProperty | SetControlForeColor | SetControlColors | SetDefaultControlColors