From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-03-2007 03:54 PM
01-04-2007 05:04 PM
01-04-2007 05:09 PM - edited 01-04-2007 05:09 PM
It's true that you can use the label text and discover the active panel by means of a series of comparisons between strings, but it seems to me not the best way to go and surely not the fastest. The same consideration applies to ATTR_CONSTANT_NAME (the panel attributes which returns the text of the constant name, e.g. "MyPanel"). Moreover, this last solution leads to these additional critical points
1. If you load a panel more than once, this approach doesn't give you a unique solution
2. On the other side, supposing you can retrieve the value associated to the constant name, this value is unique only if all tab panel are defined in the same UIR file, otherwise their IDs could overlap
In my opinion your solution of programmatically load panels and save panel handles in a array is the only possible way to go, since only panel handles are unique throughout the whole application.
BTW, in the header file associated with the UIR panel constant names are listed too: in every group of #defines that refer to a panel and its controls, the very first is the panel constant name with its associated value (used in LoadPanel).
Message Edited by Roberto Bozzolo on 01-05-2007 12:15 AM
08-30-2014 08:35 AM
To your point, there is a way to look up the index of a selected tab page with a call to GetCtrlIndex. Works well.
For myself, I have been searching for a way to find the index of a tab page before selecting it for a while now. Like a nice rational definition of pi, it just dont' exist!
Your thought of programmatically adding a panel to a tab control is likely the only way to go, if you are trying to define tab page panel handles before they are selected.