04-09-2021 05:26 AM
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?
Solved! Go to Solution.
04-09-2021 06:41 AM
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.
04-09-2021 08:12 AM
Aha! Thanks!