注: 関連付けられた UltraCalendarInfo コンポーネントの LogicalDayDuration プロパティが 24 時間未満の TimeSpan に設定されたとき、指定された時間に対応する TimeSlot が存在しないためには、このメソッドは null を返すことができます。
Imports System.Diagnostics Imports Infragistics.Win Imports Infragistics.Win.UltraWinSchedule Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim timeSlot As TimeSlot = Me.UltraDayView1.GetTimeSlotFromTime(New DateTime(1, 1, 1, 12, 15, 0)) If Not timeSlot Is Nothing Then Debug.WriteLine("The TimeSlot that contains the time 12:15 starts at " + timeSlot.StartTime.ToLongTimeString() + " and ends at " + timeSlot.EndTime.ToLongTimeString()) End If End Sub
using System.Diagnostics; using Infragistics.Win; using Infragistics.Win.UltraWinSchedule; private void button2_Click(object sender, System.EventArgs e) { TimeSlot timeSlot = this.ultraDayView1.GetTimeSlotFromTime(new DateTime(1, 1, 1, 12, 15, 00)); if (timeSlot != null) Debug.WriteLine("The TimeSlot that contains the time 12:15 starts at " + timeSlot.StartTime.ToLongTimeString() + " and ends at " + timeSlot.EndTime.ToLongTimeString()); }