Skip to main content

DateNavigator.GetHitInfo(MouseEventArgs) Method

Obtains information on the DateNavigator control’s element located at the specified point.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v24.2.dll

Declaration

public override CalendarHitInfo GetHitInfo(
    MouseEventArgs e
)

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.

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);
}
See Also