NavBarHitInfo.HitTest Property

Gets the control's section over which the test point resides.

Namespace: DevExpress.XtraNavBar

Assembly: DevExpress.XtraNavBar.v20.1.dll

Declaration

public NavBarHitTest HitTest { get; }
Public ReadOnly Property HitTest As NavBarHitTest

Property Value

Type Description
NavBarHitTest

A NavBarHitTest enumeration value indicating the control's section over which the test point resides.

Remarks

Use the NavBarControl.CalcHitInfo method to calculate hit information for a specified test point. The HitTest property of the returned NavBarHitInfo object allows you to identify the control's section over which the test point resides. This property's return value can identify that a point is over a group, link, etc. Use the NavBarHitInfo.Group and NavBarHitInfo.Link properties to obtain the point over which a group or link the point rests.

Examples

The following sample code represents a handler for the MouseMove event. It calculates hit information for the mouse pointer's position via the NavBarControl.CalcHitInfo method. Then, the type of the element that is hovered over is assigned to a string variable.

private void navBarControl1_MouseMove(object sender, MouseEventArgs e) {
   // calculating hit information by the current mouse pointer position
   NavBarHitInfo hitInfo = navBarControl1.CalcHitInfo(new Point(e.X, e.Y));
   // obtaining the type of the element which is under the mouse pointer
   string element = hitInfo.HitTest.ToString();
   // ...
}
See Also