LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Selecting controls in a specific tab

Solved!
Go to solution

Hi!

 

I have a panel (PANEL), which has a tab structure (PANEL_TAB) with two tabs (TABPANEL and TABPANEL_2). These names were automatically generated when I created them. In each tab I have a single text box control (called A in TABPANEL and B in TABPANEL_2, giving them their full constant names TABPANEL_A and TABPANEL_2_B). I can see in my *.h file that these two constants have the same integer value. I'd like to get the text of control B by doing the following:

if ((panelHandle = LoadPanel (0, "tab_experiment.uir", PANEL)) < 0)
    return -1;

int tabHandle;
GetPanelHandleFromTabPage(panelHandle, PANEL_TAB, 0, &tabHandle);
char* mystring = "tyujkijolkjdilksahdikjsh";
GetCtrlAttribute(tabHandle, TABPANEL_2_B, ATTR_DFLT_VALUE, mystring);

...Which gives me the text string in TABPANEL_A. How can I get the text string for TABPANEL_2_B instead?

0 Kudos
Message 1 of 3
(1,320 Views)
Solution
Accepted by topic author guybrush_threepwood

The solution lies in the 'index' parameter of GetPanelHandleFromTabPage, whit permits you to select which tab page to address.

 By setting the index to the appropriate value you can address the controls in that specific page and get/set their values and attributes.

In your case, setting 1 as the index will return the handle of TABPANEL_2 page.



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?
Message 2 of 3
(1,292 Views)

Aha! Thanks!

0 Kudos
Message 3 of 3
(1,284 Views)