NavBarHitInfo.HitTest Property
Gets the control’s section over which the test point resides.
Namespace: DevExpress.XtraNavBar
Assembly: DevExpress.XtraNavBar.v24.2.dll
NuGet Package: DevExpress.Win
#Declaration
#Property Value
Type | Description |
---|---|
Nav |
A Nav |
Available values:
Name | Description |
---|---|
None | The test point is not over one of the mentioned elements or outside the control. |
Group |
The test point is over a group caption. |
Group |
The test point is over a group’s client area. |
Group |
The test point is over a group expanding/collapsing button. |
Up |
The test point is over an up scroll button. |
Down |
The test point is over a down scroll button. |
Link | The test point is over a link. |
Link |
The test point is over a link caption. |
Link |
The test point is over a link image. |
Navigation |
The test point is over the splitter that divides the currently expanded group from group buttons when the “Navigation |
Navigation |
The test point is over the header that is displayed at the control’s top edge when the “Navigation |
Navigation |
The test point is over the empty region of the Overflow panel. This panel is available when the “Navigation |
Navigation |
The test point is over a button within the Overflow panel that is available when the “Navigation |
Group |
The test point is over a group’s bottom header, these are displayed when the Xtra |
Group |
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 Xtra |
Expand |
The test point belongs to the expand button (in the Navigation |
Content |
The test point belongs to the content button (in the Navigation |
#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();
// ...
}