A Tree-List Box is a List Box control that displays its items in a hierarchical structure. Each item can display an image and/or a checkbox along with its text, and can optionally display a "TreeButton" when it has sub-items that can be shown or hidden. It shares many of the attributes of the Windows TreeView Common Control, but its API is position-based rather than node-based, making it an easier fit with Basic+ programming.
Developer Notes
1. The TREELISTBOX control is essentially a modified LISTBOX control and therefore supports many of the same properties, with a few exceptions noted below.
2. In previous versions of OpenInsight this control was known as a "Hierarchical List Box", but it has been renamed in this version due to the significant increase in functionality.
Item Indexes in the TREELISTBOX control
A Tree-List Box control has two methods of referring to an item when using the properties and methods described below: These are:
1. by the "Fully-Expanded" (or "X" for eXpanded) index, and
2. by the "Visible" index.
The Fully-Expanded index is used to access an item regardless of whether or not it is currently being displayed in the control. For example, consider the Tree-List Box below in its fully expanded state which consists of 5 items in total.
To reference the second item, XXX, we could use an index of 2 along with the LIST property to get its text value like so (just as we would with a standard List Box control):
The LIST property works with a "Visible" index so it interprets the "2" as second item that is displayed in the control.
If the first item is collapsed then only three items as can now been seen:
We can no longer use the LIST property to access the XXX item because it is no longer visible, and if we did so we would end up accessing the XXXX item.
So for this we now have to use the LISTX property instead. This interprets the "2" as an index into the fully-expended list, so we access the correct item. So, when you need to access an item regardless of whether or not it is visible you should always use one of the "X" properties or methods