OfficeNavigationBar.CalcHitInfo(Point) Method
Returns information about the visual element under the specified hit point.
Namespace: DevExpress.XtraBars.Navigation
Assembly: DevExpress.XtraBars.v24.1.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
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