Adding Nodes

Nodes are added to the TreeView by clicking on the button to the right of the Nodes property, which brings up the TreeNode Editor shown in Figure 10.38.

j'reeMode Editor

Select node to edit:

j'reeMode Editor

Select node to edit:

□ Add Root Add Child Delete |

Label JFjodeO Image:


Selected Innag (Default)


Figure 10.38: The TreeNode Editor dialog.

When you first display the editor, you'll only be allowed to add a root node. Once you've added the root node, you can select any node in the tree and add children. The fields at the bottom of the dialog let you change the text and the two icons that are associated with a node. Figure 10.39 shows the result of adding four nodes to a TreeView.

31 Form I


31 Form I

Figure 10.39: A TreeView containing four nodes. Note

It is quite acceptable to have more than one root node in a TreeView.

0 0

Post a comment