Imports System.Diagnostics
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
Private Sub UltraDayView1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles UltraDayView1.MouseMove
' Create a point from the X and Y coordinates passed in the MouseEventArgs
Dim point As Point = New Point(e.X, e.Y)
' -----------------------------------------------------------------------
' Get the Appointment under the point and display a message in the output window if we find one.
Dim appointment As Appointment = Me.UltraDayView1.GetAppointmentFromPoint(e.X, e.Y)
' NOTE: Could also call GetAppointmentFromPoint passing in a point.
' appointment = Me.ultraDayView1.GetAppointmentFromPoint(point)
If Not appointment Is Nothing Then
Debug.WriteLine("Appointment '" + appointment.Subject + "' is under the mouse point (" + point.ToString() + ")")
End If
' -----------------------------------------------------------------------
' Get the TimeSlot under the point and display a message in the output window if we find one.
Dim timeSlot As TimeSlot = Me.UltraDayView1.GetTimeSlotFromPoint(e.X, e.Y)
' NOTE: Could also call GetTimeSlotFromPoint passing in a point.
' timeSlot = Me.ultraDayView1.GetTimeSlotFromPoint(point)
If Not timeSlot Is Nothing Then
Debug.WriteLine("The TimeSlot starting at " + timeSlot.StartTime.ToLongTimeString() + " and ending at " + timeSlot.EndTime.ToLongTimeString() + " is under the mouse point (" + point.ToString() + ")")
End If
' -----------------------------------------------------------------------
' Get the VisibleDay under the point and display a message in the output window if we find one.
Dim visibleDay As VisibleDay = Me.UltraDayView1.GetVisibleDayFromPoint(e.X, e.Y)
' NOTE: Could also call GetVisibleDayFromPoint passing in a point.
' visibleDay = Me.ultraDayView1.GetVisibleDayFromPoint(point)
If Not visibleDay Is Nothing Then
Debug.WriteLine("The VisibleDay for " + visibleDay.Date.ToLongDateString() + " is under the mouse point (" + point.ToString() + ")")
End If
End Sub