LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with nested tabs

I am updating my application to take advantage of tabs in CVI 8.0.  I am using nested tabs.  That is, I have a tab control on another tab control.

The problem is that I cannot get a Panel Handle for a tab within a tab.  I know that CVI is assigning unique panel IDs to these tabs because I wrote a timer routine where each tab "registers" itself. This is not a vey clean way to get panel handles but it allowed me to see that sub-tabs can be addressed and programmed just like panels.

Anyway, the following pseudo-code explains what I am trying to do:

status = GetPanelHandleFromTabPage (ParentPanelHandle,  TAB_ON_MAIN_PANEL, 0, &tabHandle1);
status = GetPanelHandleFromTabPage (tabHandle1,  TAB_ON_SUB_PANEL, 0, &tabHandle2);  // note I am passing the handle from step 1

The first call to GetPanelHandleFromTabPage works fine.  The second call returns this error:

Library function error (return value == -10 [0xfffffff6]).
The control is not the type expected by the function

Thanks.
Message 1 of 2
(2,801 Views)

I think the problem is the ControlID that you're passing to GetPanelHandleFromTabPage. Is TAB_ON_SUB_PANEL the constant name of the nested tab control? You have to concatenate that to the constant name of the tab panel of the parent tab control. Take a look at the generated constants in the UIR include file.

I've attached a sample program that gets the panel handle of the nested tab control's tab panel.

Hope this helps.

- jared

0 Kudos
Message 2 of 2
(2,788 Views)