SetControlVisibility
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 SetControlVisibility(char[] panel, char[] control, long visible);
Function
Sets the visibility 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
Name of the control, restricted to 128 characters.You can only activate/deactivate the control with its name. In the property dialog of the control it's name is assigned/displayed. If you want to use the name of a symbol (signal or environment/system variable) you have to ensure that the control hasnoname instead of the individual control's name. The name of the environment variable, system variable or signal could be specified as following. The form for signals is: "Signal:
visible
Sets if the panel element should be visible or not. visible = 1 => Panel element is visiblevisible = 0 => Panel element is not visible
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 visibility for a specific control of a panel
SetControlVisibility("motor", "PedalPos", 1);
// All controls of the panel are set to not visible
SetControlVisibility("motor", "", 0);
// All controls of all panels are set to visible
SetControlVisibility("", "", 1);
Related APIs
SetControlBackColor | SetControlProperty | SetControlColors | SetDefaultControlColors