Version

GetAppointmentFromPoint(Int32,Int32) Method

Returns the Appointment under the point or null if there is no Appointment at the point.
Syntax
'Declaration
 
Public Overloads Function GetAppointmentFromPoint( _
   ByVal x As Integer, _
   ByVal y As Integer _
) As Appointment
public Appointment GetAppointmentFromPoint( 
   int x,
   int y
)

Parameters

x
The x-coordinate of the point to test
y
The y-coordinate of the point to test

Return Value

Appointment
Example
The following code demonstrates how to call the various 'Object From Point' methods on the UltraDayView control.

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
using System.Diagnostics;
using Infragistics.Win;
using Infragistics.Win.UltraWinSchedule;


		private void 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() + ")");

		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also