DateNavigator.GetHitInfo(MouseEventArgs) Method
Obtains information on the DateNavigator control’s element located at the specified point.
Namespace: DevExpress.XtraScheduler
Assembly: DevExpress.XtraScheduler.v19.2.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
e | MouseEventArgs | A MouseEventArgs object that contains the test point coordinates. |
Returns
Type | Description |
---|---|
CalendarHitInfo | A CalendarHitInfo object containing information about the element at the test point. |
Remarks
Use the GetHitInfo method to obtain detailed information on the element located at the specified point within the DateNavigator control. Call the GetHitInfo method within the mouse event handler and use the CalendarHitInfo.HitTest property of the returned object to identify the element’s type.
This example uses the DateNavigator.GetHitInfo
method to obtain information on the point which the mouse hovers over. The information is displayed it in the application window caption.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-implement-hit-testing-for-the-datenavigator-control-t149436
private void dateNavigator1_MouseMove(object sender, MouseEventArgs e)
{
DevExpress.XtraEditors.Calendar.CalendarHitInfo hitInfo = dateNavigator1.GetHitInfo(e);
string s1 = hitInfo.HitTest.ToString();
string s2 = hitInfo.HitDate.ToShortDateString();
string s3 = hitInfo.HitPoint.ToString();
this.Text = String.Format("HitInfo for {0} - Date: {1} Point: {2}", s1, s2, s3);
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the GetHitInfo(MouseEventArgs) 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.