NavBarControl.CalcHitInfo(Point) Method
Gets an object containing information about the control at a specified point.
Namespace: DevExpress.XtraNavBar
Assembly: DevExpress.XtraNavBar.v19.2.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
p | Point | A System.Drawing.Point object specifying the examined point. |
Returns
Type | Description |
---|---|
NavBarHitInfo | A NavBarHitInfo object providing information about the control’s specified point. |
Remarks
Use the CalcHitInfo method to determine control elements over which a specified point resides and obtain objects representing these elements. Review the NavBarHitInfo class description for more details on information it provides.
Example
The following sample code represents a handler for the MouseMove event. It calculates hit information for the mouse pointer’s position via the NavBarControl.CalcHitInfo
method. Then, the type of the element that is hovered over is assigned to a string variable.
private void navBarControl1_MouseMove(object sender, MouseEventArgs e) {
// calculating hit information by the current mouse pointer position
NavBarHitInfo hitInfo = navBarControl1.CalcHitInfo(new Point(e.X, e.Y));
// obtaining the type of the element which is under the mouse pointer
string element = hitInfo.HitTest.ToString();
// ...
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the CalcHitInfo(Point) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.