NavBarHitInfo.HitTest Property
Gets the control’s section over which the test point resides.
Namespace: DevExpress.XtraNavBar
Assembly: DevExpress.XtraNavBar.v24.1.dll
NuGet Packages: DevExpress.Win, DevExpress.Win.Navigation
Declaration
Property Value
Type | Description |
---|---|
NavBarHitTest | A NavBarHitTest enumeration value indicating the control’s section over which the test point resides. |
Available values:
Name | Description |
---|---|
None | The test point is not over one of the mentioned elements or outside the control. |
GroupCaption | The test point is over a group caption. |
GroupClient | The test point is over a group’s client area. |
GroupCaptionButton | The test point is over a group expanding/collapsing button. |
UpButton | The test point is over an up scroll button. |
DownButton | The test point is over a down scroll button. |
Link | The test point is over a link. |
LinkCaption | The test point is over a link caption. |
LinkImage | The test point is over a link image. |
NavigationPaneSplitter | The test point is over the splitter that divides the currently expanded group from group buttons when the “NavigationPane” view is applied. |
NavigationPaneHeader | The test point is over the header that is displayed at the control’s top edge when the “NavigationPane” view is applied. |
NavigationPaneOverflowPanel | The test point is over the empty region of the Overflow panel. This panel is available when the “NavigationPane” view is applied. |
NavigationPaneOverflowPanelButton | The test point is over a button within the Overflow panel that is available when the “NavigationPane” view is applied. |
GroupBottom | The test point is over a group’s bottom header, these are displayed when the XtraNavBar is painted using the SkinExplorerBarView style. |
GroupBottomButton | The test point is over a button used to expand/collapse a group. Such a button is displayed at the bottom of each group when the XtraNavBar control is painted using the SkinExplorerBarView style. |
ExpandButton | The test point belongs to the expand button (in the NavigationPane paint style). |
ContentButton | The test point belongs to the content button (in the NavigationPane paint style). |
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.
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 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();
// ...
}