System.Windows.Forms.TreeView.GetNodeAt Method

Retrieves the tree node at the point with the specified coordinates.

Syntax

public TreeNode GetNodeAt (int x, int y)

Parameters

x
The System.Drawing.Point.X position to evaluate and retrieve the node from.
y
The System.Drawing.Point.Y position to evaluate and retrieve the node from.

Returns

The System.Windows.Forms.TreeNode at the specified location, in tree view (client) coordinates, or null if there is no node at that location.

Remarks

You can pass the MouseEventArgs.X and MouseEventArgs.Y coordinates of the Control.MouseDown event as the x and y parameters.

Requirements

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