OfficeNavigationBar.CalcHitInfo(Point) Method

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

Namespace: DevExpress.XtraBars.Navigation

Assembly: DevExpress.XtraBars.v20.1.dll

Declaration

public OfficeNavigationBarHitInfo CalcHitInfo(
    Point point
)
Public Function CalcHitInfo(
    point As Point
) As OfficeNavigationBarHitInfo

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.

Examples

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