Children Property

       

Returns the number of child Node objects contained in a Node object.

Syntax

object.Children

The object placeholder represents an object expression that evaluates to an object in the Applies To list.

Remarks

The Children property can be used to check if a Node object has any children before performing an operation that affects the children. For example, the following code checks for the presence of child nodes before retrieving the Text property of the first Node, using the Child property.

Private Sub TreeView1_NodeClick(ByVal Node As Node)
   If Node.Children > 0 Then
      MsgBox Node.Child.Text
   End If
End Sub