LabWindows/CVI Control on Tab Control Not Responding

Updated Jun 15, 2023

Reported In

Software

  • LabWindows/CVI

Issue Details

I'm building a LabWindows/CVI program which uses a tab control to house and organize some of the front panel objects used by my program. When I try to interact with these objects or execute a callback function on them, the objects don't respond or change. If I move these objects outside of the tab control, they respond correctly. What is causing this behavior?

Solution

This issue is caused by using the panel handle for the program window which houses the front panel object when executing a callback or editing a property instead of the panel handle for the Tab control page. Tab controls in LabWindows/CVI have unique handles for each tab page present in the tab control. In order to interact with objects contained in a tab page of a tab control, you need to get and use that tab page's panel handle in callbacks and functions that refer to those objects, such as SetCtrlAttribute() .

The panel handle for a tab page in a tab control can be obtained using the GetPanelHandlefromTabPage() function. This tab page panel handle can then be used to appropriately refer to front panel objects housed in a tab control in your program.