TreeNode.GetNodeCount Method (Boolean)


Returns the number of child tree nodes.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

member GetNodeCount : 
        includeSubTrees:bool -> int


Type: System.Boolean

true if the resulting count includes all tree nodes indirectly rooted at this tree node; otherwise, false.

Return Value

Type: System.Int32

The number of child tree nodes assigned to the Nodes collection.

The following code example sets the PathSeparator property of a TreeView and displays the number of child tree nodes that are contained in the TreeNodeCollection of the SelectedNode. The percentage of child tree node to total tree nodes in the tree view control is also displayed. This example requires that you have a Form with a Button, and a TreeView control with a TreeNodeCollection that has several TreeNode objects (preferably with three or more levels).

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top