Back to Devexpress

NavigationPane.CalcHitInfo(Point) Method

windowsforms-devexpress-dot-xtrabars-dot-navigation-dot-navigationpane-dot-calchitinfo-x28-system-dot-drawing-dot-point-x29.md

latest2.6 KB
Original Source

NavigationPane.CalcHitInfo(Point) Method

Returns the information for the navigation page that is located at the target coordinates.

Namespace : DevExpress.XtraBars.Navigation

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public INavigationPageBase CalcHitInfo(
    Point pt
)
vb
Public Function CalcHitInfo(
    pt As Point
) As INavigationPageBase

Parameters

NameTypeDescription
ptPoint

A Point structure that is the NavigationPane coordinates for which page information should be returned.

|

Returns

TypeDescription
DevExpress.XtraBars.Navigation.INavigationPageBase

A DevExpress.XtraBars.Navigation.INavigationPageBase object that contains information about the NavigationPane page located at the target coordinates.

|

Remarks

The following example demonstrates how to use the CalcHitInfo method to obtain information about the navigation page located at the mouse pointer position:

csharp
private void navigationPane1_MouseClick(object sender, MouseEventArgs e) {
    var pageInfo = navigationPane1.CalcHitInfo(Cursor.Position);
    if (pageInfo != null)
        MessageBox.Show(String.Format("You clicked within the '{0}' page.", pageInfo.PageText), "Information", MessageBoxButtons.OK);
}
vb
Private Sub navigationPane1_MouseClick(ByVal sender As Object, ByVal e As MouseEventArgs)
    Dim pageInfo = navigationPane1.CalcHitInfo(Cursor.Position)
    If pageInfo IsNot Nothing Then
        MessageBox.Show(String.Format("You clicked within the '{0}' page.", pageInfo.PageText), "Information", MessageBoxButtons.OK)
    End If
End Sub

See Also

NavigationPane Class

NavigationPane Members

DevExpress.XtraBars.Navigation Namespace