Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Get the Link That Is Hovered Over

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 link that is hovered over is accessed.

using DevExpress.XtraNavBar;

private void navBarControl1_MouseMove(object sender, MouseEventArgs e) {
   NavBarHitInfo hitInfo = navBarControl1.CalcHitInfo(new Point(e.X, e.Y));
   if (hitInfo.InLink) {
      NavBarItemLink link = hitInfo.Link;
      // perform operations on the link here
      //...
   }
}