TreeViewHitTestInfo Class

Definition

Contains information about an area of a TreeView control or a TreeNode.

public ref class TreeViewHitTestInfo
public class TreeViewHitTestInfo
type TreeViewHitTestInfo = class
Public Class TreeViewHitTestInfo
Inheritance
TreeViewHitTestInfo

Examples

The following code example demonstrates how to use the TreeViewHitTestInfo class. To run this example, paste the following code into a Windows Form that contains a TreeView control named treeView1, and populate the TreeView with items. Ensure that treeview1 and the MouseDown event for the form are associated with the HandleMouseDown method.

void HandleMouseDown(object sender, MouseEventArgs e)
{
    TreeViewHitTestInfo info = treeView1.HitTest(e.X, e.Y);
    if (info != null)
        MessageBox.Show("Hit the " + info.Location.ToString());
}
Private Sub HandleMouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) _
    Handles Me.MouseDown, treeView1.MouseDown
    Dim info As TreeViewHitTestInfo = treeView1.HitTest(e.X, e.Y)
    If (info IsNot Nothing) Then
        MessageBox.Show("Hit the " + info.Location.ToString())
    End If

End Sub

Remarks

The TreeViewHitTestInfo is returned by the TreeView class when the HitTest method is called.

Constructors

TreeViewHitTestInfo(TreeNode, TreeViewHitTestLocations)

Initializes a new instance of the TreeViewHitTestInfo class.

Properties

Location

Gets the location of a hit test on a TreeView control, in relation to the TreeView and the nodes it contains.

Node

Gets the TreeNode at the position indicated by a hit test of a TreeView control.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to