Back to Devexpress

TreeListHitInfo Class

windowsforms-devexpress-dot-xtratreelist-3f2ef8ba.md

latest2.8 KB
Original Source

TreeListHitInfo Class

Represents a class that contains information about what is located at a specific point within the TreeList control.

Namespace : DevExpress.XtraTreeList

Assembly : DevExpress.XtraTreeList.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList

Declaration

csharp
public class TreeListHitInfo
vb
Public Class TreeListHitInfo

The following members return TreeListHitInfo objects:

Remarks

These class members can be used to provide a user with information about a specific point of the TreeList control. The TreeList.CalcHitInfo method of the TreeList object returns a TreeListHitInfo class instance containing information about a specific point of the TreeList control.

Example

The code below obtains the name of the element located under the mouse pointer. The MouseMove event is handled to track mouse pointer movement.

csharp
using DevExpress.XtraTreeList;
//...
private void treeList1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) {
   TreeListHitInfo hi = treeList1.CalcHitInfo(new Point(e.X, e.Y));
   string elementName = hi.HitInfoType.ToString();
   //...
}
vb
Imports DevExpress.XtraTreeList
'...
Private Sub TreeList1_MouseMove(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles TreeList1.MouseMove
   Dim hi As TreeListHitInfo = TreeList1.CalcHitInfo(New Point(e.X, e.Y))
   Dim ElementName As String = hi.HitInfoType.ToString()
   ' ...
End Sub

Inheritance

Object TreeListHitInfo

See Also

TreeListHitInfo Members

DevExpress.XtraTreeList Namespace