Läs på engelska Redigera

Dela via


TreeViewHitTestInfo Class

Definition

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

C#
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.

C#
void HandleMouseDown(object sender, MouseEventArgs e)
{
    TreeViewHitTestInfo info = treeView1.HitTest(e.X, e.Y);
    if (info != null)
        MessageBox.Show("Hit the " + info.Location.ToString());
}

Remarks

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

Constructors

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

Produkt Versioner
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10