Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

OfficeNavigationBar.CalcHitInfo(Point) Method

Returns information about the visual element under the specified hit point.

Namespace: DevExpress.XtraBars.Navigation

Assembly: DevExpress.XtraBars.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

public OfficeNavigationBarHitInfo CalcHitInfo(
    Point point
)

#Parameters

Name Type Description
point Point

The hit point, relative to the Office Navigation Bar’s top-left corner.

#Returns

Type Description
OfficeNavigationBarHitInfo

An object that cointains information about the Office Navigation Bar’s elements located at the test point.

#Example

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);
    }
}
See Also