Dynamically Trigger an Event Using Controls Inside a Tab Control

Updated Oct 8, 2024

Reported In

Software

  • LabVIEW

Issue Details

I want to dynamically trigger an event in the event structure while any value change happens in any controls inside a tab control, how can I achieve this?

Solution

To achieve this goal you will need to use the property node to access the reference for controls in the tab controls. The snippet code below shows how to register all controls in a tab control to trigger event structure when any value change happens on any of the controls.
Example_Event_Tab.png
Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.

The snippet code above is created from LabVIEW 2020 32-bit, if you are using a higher version of LabVIEW, you might not find the CtlsOnPage property. In this case, please try searching for the Z-Order:Control[] property.

Additional Information

If you need to trigger an event when a value change happens on any controls from the front panel including controls inside and outside of the tab control, you can modify the above code to include references from controls outside the tab control. However, do take note that you need to exclude the tab control reference if the tab-switching action is not expected to count as the trigger action. The snippet code below is an example to exclude the tab control reference:
Example_Event_Tab02.png
If you have multiple tab controls that need to be excluded, you can manage the reference array using array-related API to exclude those tab controls' references before registering an event.