Skip to main content

How to: Get the Group 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 group 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.InGroup) {
      NavBarGroup group = hitInfo.Group;
      // perform operations on the group here
      //...
   }
}