LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Tab control

Hi
I need to use a tab control to show data from different source.
I use a tab control and programmatly i copy first tab panel for different
time how are my source.
How can i get access at text box in other panel.
I make confusion with GetPanelHandleFromTabPanel function.
Anyone can explain me ???
How i have to call control in SetCtrlVal function..
i tried in this way:
GetPanelHandleFromTabPanel(hPanel,PANEL_TAB,tabIndex,&hTabPanel)
SetCtrlVal(hTabPanel, ?????, x);

wrong...

i also tried
GetPanelHandleFromTabPanel( hPanel, PANEL_TAB, tabIndex, &hTabPanel)
SetCtrlVal( hPanel, hTabPanel, x);

Please help me.

Thank's
Marco


0 Kudos
Message 1 of 3
(4,454 Views)

Hello Marco,

tab controls can be somewhat confusing if you don't understandclearly that each page on a tab control is in effect an indipendent panel, with its proper handle that is to be used to address control on the tab page itself. This item has been discussed several times in the forum and a simple search will return you lots of informations and examples to study. Among all, useful discussions can be found here, here and here.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(4,452 Views)

Hi as it was said a tab control is like multiple panels, each page is a panel...
So you have to recover an handle for each page with the function GetPanelHandleFromTabPage. This function allows us to recover an handle for each page.
Then you use this handle to modify objects in the tab.

Here is an example of code modifying a string control in a tab control.

GetPanelHandleFromTabPage (panelHandle, PANEL_TAB, 0, &TabHandle);
SetCtrlVal (TabHandle, TABPANEL_STRING, "Hello");

If you look at the header file of the project you will see that the objects on the tab controls are named (TAB NAME)PANEL_(CONTROL NAME)

Kamal
Datus Rhone Alpes

 

0 Kudos
Message 3 of 3
(4,418 Views)