Chapter 21: Tree and List Controls Visual C++ and MFC Fundamentals
21.1 The Tree Control.........................................................................................
21.1.1..Overview...............................................................................................
A tree control is an object that displays a hierarchical list of items arranged as a physical
tree but a little upside down. The items display in a parent-child format to show those that
belong to interrelated categories, such as parent to child and child to grandchild, etc; or
folder to subfolder to file. Here is an example of a tree list:
Figure 57: A Tree List With One Root....................................................................................
The starting item of the tree is sometimes called the root and represents the beginning of
the tree. While most tree list have one root, it is not unusual to have a tree list that has
many roots, as long as the tree creator judges it necessary. Here is an example:
Figure 58: A Tree List With Various Roots............................................................................
Each item, including the root, that belongs to the tree is referred to as a node. An item
that belongs to, or depends on, another can also be called a leaf. In the following charts,
the down arrow means, "has the following child or children":