System.Windows.Forms.TreeNodeCollection.ContainsKey Method

Determines whether the collection contains a tree node with the specified key.

Syntax

public virtual bool ContainsKey (string key)

Parameters

key
The name of the System.Windows.Forms.TreeNode to search for.

Returns

true to indicate the collection contains a System.Windows.Forms.TreeNode with the specified key; otherwise, false.

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, the TreeNodeCollection.Item(string) property returns false.

Requirements

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