Back to Devexpress

NavBarHitInfo.Group Property

windowsforms-devexpress-dot-xtranavbar-dot-navbarhitinfo-4dfa74e7.md

latest3.4 KB
Original Source

NavBarHitInfo.Group Property

Gets a group over whose area a test point resides.

Namespace : DevExpress.XtraNavBar

Assembly : DevExpress.XtraNavBar.v25.2.dll

NuGet Package : DevExpress.Win

Declaration

csharp
public NavBarGroup Group { get; }
vb
Public ReadOnly Property Group As NavBarGroup

Property Value

TypeDescription
NavBarGroup

A NavBarGroup object representing the group located under a test point. null ( Nothing in Visual Basic) if the test point is not over a control group.

|

Remarks

Use the NavBarControl.CalcHitInfo method to obtain information about a specified point’s location with respect to the control. If a specified point resides over the group (its caption or client area), the method assigns the NavBarGroup object representing this group to the Group property of the returned NavBarHitInfo object. If a specified point is not over the group, the Group property returns null ( Nothing in Visual Basic).

You can determine whether the test point is over a group or group caption via the NavBarHitInfo.InGroup and NavBarHitInfo.InGroupCaption properties respectively.

Example

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.

csharp
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
      //...
   }
}
vb
Imports DevExpress.XtraNavBar

Private Sub NavBarControl1_MouseMove(ByVal sender As Object, _
  ByVal e As MouseEventArgs) Handles NavBarControl1.MouseMove
   ' calculating hit information by the current mouse pointer position
   Dim HitInfo As NavBarHitInfo = NavBarControl1.CalcHitInfo(New Point(e.X, e.Y))
   If HitInfo.InGroup Then
      Dim Group As NavBarGroup = HitInfo.Group
      ' perform operations on the group here
      '...
   End If
End Sub

See Also

Link

CalcHitInfo(Point)

NavBarHitInfo Class

NavBarHitInfo Members

DevExpress.XtraNavBar Namespace