System.Windows.Forms.TreeNodeCollection.Find Method

Finds the tree nodes with specified key, optionally searching subnodes.

Syntax

public TreeNode[] Find (string key, bool searchAllChildren)

Parameters

key
The name of the tree node to search for.
searchAllChildren
true to search child nodes of tree nodes; otherwise, false.

Returns

An array of System.Windows.Forms.TreeNode objects whose TreeNode.Name property matches the specified key.

Remarks

The TreeNode.Name property corresponds to the key for a System.Windows.Forms.TreeNode in the System.Windows.Forms.TreeNodeCollection.

The key comparison is not case-sensitive. If the key parameter is null or an empty string, or there are no matches, the TreeNodeCollection.Item(string) property returns an empty array.

Requirements

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