06-14-2007 07:24 AM
06-14-2007 08:07 AM
Within CVI all resources are addressed via handles, in case of UIR controls the couple panel handle / control ID. In your case, with tab controls included in a page or another tab control, the crucial point is to retrieve the correct panel handle. The main rule is that every tab page is really a separate panel with its own handle, particularly a child panel of the panel the tab control is in. (BTW, this process can be recursively applied if the parent panel of the tab control is itself a page af a tab control residing on another panel like in your case. But this has no effect in this discussion)
Now, if you want to address a control located on a page of a tab control, you must get the handle of the "panel" which really is that particular page of the tab control: the handle can be obtained via GetPanelHandleFromTabPage function. As an example, consider you want to set some attribute of the led located on tab0 on the tab control in "Other controls" panel in tabpanels sample shipped with cvi (you can find it in samples\userint folder): these instructions permits you to set the on color of that led to blue:
GetPanelHandleFromTabPage (gOtherPanel, OTHER_PNL_TAB, 0, &tabpanel);
SetCtrlAttribute (tabpanel, TABPANEL_LED, ATTR_ON_COLOR, VAL_BLUE);
The trick, as you see, is to start with the correct panel handle.
06-14-2007 08:16 AM
06-14-2007 08:38 AM - edited 06-14-2007 08:38 AM
Message Edited by Roberto Bozzolo on 06-14-2007 03:39 PM