windowsforms-devexpress-dot-xtrabars-dot-navigation-dot-officenavigationbar-dot-calchitinfo-x28-system-dot-drawing-dot-point-x29.md
Returns information about the visual element under the specified hit point.
Namespace : DevExpress.XtraBars.Navigation
Assembly : DevExpress.XtraBars.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
public OfficeNavigationBarHitInfo CalcHitInfo(
Point point
)
Public Function CalcHitInfo(
point As Point
) As OfficeNavigationBarHitInfo
| Name | Type | Description |
|---|---|---|
| point | Point |
The hit point, relative to the Office Navigation Bar’s top-left corner.
|
| Type | Description |
|---|---|
| OfficeNavigationBarHitInfo |
An object that cointains information about the Office Navigation Bar’s elements located at the test point.
|
The code below shows how to remove a navigation item with a right click.
using DevExpress.XtraBars.Navigation;
private void OfficeNavigationBar1_MouseDown(object sender, MouseEventArgs e) {
if (e.Button == MouseButtons.Right) {
var bar = sender as OfficeNavigationBar;
var hitInfo = bar.CalcHitInfo(e.Location);
if (hitInfo.HitTest == OfficeNavigationBarHitTest.Item)
bar.Items.Remove(hitInfo.Item);
}
}
Imports DevExpress.XtraBars.Navigation
Private Sub OfficeNavigationBar1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) _
Handles officeNavigationBar1.MouseDown
If e.Button = MouseButtons.Right Then
Dim bar = TryCast(sender, OfficeNavigationBar)
Dim hitInfo = bar.CalcHitInfo(e.Location)
If hitInfo.HitTest = OfficeNavigationBarHitTest.Item Then
bar.Items.Remove(hitInfo.Item)
End If
End If
End Sub
See Also