System.Windows.Forms.TreeNode.FromHandle Method

Returns the tree node with the specified handle and assigned to the specified tree view control.

Syntax

public static TreeNode FromHandle (TreeView tree, IntPtr handle)

Parameters

tree
The System.Windows.Forms.TreeView that contains the tree node.
handle
The handle of the tree node.

Returns

A System.Windows.Forms.TreeNode that represents the tree node assigned to the specified System.Windows.Forms.TreeView control with the specified handle.

Remarks

When a node is added to the TreeView.Nodes collection, the System.Windows.Forms.TreeView control sends an NM_CUSTOMDRAW notification before the node handle is available. If you override the Control.WndProc(Message@) method of the System.Windows.Forms.TreeView to provide custom drawing in response to this notification, you should always check the return value of this method for null before you attempt to access the node.

Requirements

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