バージョン

GetTimeSlotFromPoint(Int32,Int32) メソッド

そのポイントに位置する要素に適用される TimeSlot オブジェクトを返します。または TimeSlot オブジェクトが適用されない場合は null を返します。
シンタックス
'宣言
 
Public Overloads Function GetTimeSlotFromPoint( _
   ByVal x As Integer, _
   ByVal y As Integer _
) As TimeSlot
public TimeSlot GetTimeSlotFromPoint( 
   int x,
   int y
)

パラメータ

x
テストするポイントのx座標は、コントロールのクライアント座標で表されます。
y
テストするポイントのy座標は、コントロールのクライアント座標で表されます。

戻り値の型

TimeSlotオブジェクト、またはTimeSlotオブジェクトが適用されない場合はnull。
使用例
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() + ")");

		}
参照