Imports System.Diagnostics
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
PrivateSub UltraDayView1_MouseMove(ByVal sender AsObject, 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)
IfNot appointment IsNothingThen
Debug.WriteLine("Appointment '" + appointment.Subject + "' is under the mouse point (" + point.ToString() + ")")
EndIf' -----------------------------------------------------------------------
' 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)
IfNot timeSlot IsNothingThen
Debug.WriteLine("The TimeSlot starting at " + timeSlot.StartTime.ToLongTimeString() + " and ending at " + timeSlot.EndTime.ToLongTimeString() + " is under the mouse point (" + point.ToString() + ")")
EndIf' -----------------------------------------------------------------------
' 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)
IfNot visibleDay IsNothingThen
Debug.WriteLine("The VisibleDay for " + visibleDay.Date.ToLongDateString() + " is under the mouse point (" + point.ToString() + ")")
EndIfEnd Sub
'宣言
Public Overloads Function GetTimeSlotFromPoint( _
ByVal x As Integer, _
ByVal y As Integer _
) As TimeSlot
using System.Diagnostics;
using Infragistics.Win;
using Infragistics.Win.UltraWinSchedule;
privatevoid ultraDayView1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
// Create a point from the X and Y coordinates passed in the MouseEventArgs
Point 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.
Appointment appointment = this.ultraDayView1.GetAppointmentFromPoint(e.X, e.Y);
// NOTE: Could also call GetAppointmentFromPoint passing in a point.
// appointment = this.ultraDayView1.GetAppointmentFromPoint(point);
if (appointment != null)
Debug.WriteLine("Appointment '" + appointment.Subject + "' is under the mouse point (" + point.ToString() + ")");
// -----------------------------------------------------------------------
// Get the TimeSlot under the point and display a message in the output window if we find one.
TimeSlot timeSlot = this.ultraDayView1.GetTimeSlotFromPoint(e.X, e.Y);
// NOTE: Could also call GetTimeSlotFromPoint passing in a point.
// timeSlot = this.ultraDayView1.GetTimeSlotFromPoint(point);
if (timeSlot != null)
Debug.WriteLine("The TimeSlot starting at " + timeSlot.StartTime.ToLongTimeString() + " and ending at " + timeSlot.EndTime.ToLongTimeString() + " is under the mouse point (" + point.ToString() + ")");
// -----------------------------------------------------------------------
// Get the VisibleDay under the point and display a message in the output window if we find one.
VisibleDay visibleDay = this.ultraDayView1.GetVisibleDayFromPoint(e.X, e.Y);
// NOTE: Could also call GetVisibleDayFromPoint passing in a point.
// visibleDay = this.ultraDayView1.GetVisibleDayFromPoint(point);
if (visibleDay != null)
Debug.WriteLine("The VisibleDay for " + visibleDay.Date.ToLongDateString() + " is under the mouse point (" + point.ToString() + ")");
}
'宣言
Public Overloads Function GetTimeSlotFromPoint( _
ByVal x As Integer, _
ByVal y As Integer _
) As TimeSlot