Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
Imports System.IO
Imports System.Globalization
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
' 返されたサブセット コレクションのカウントを取得し、
' 現在の日に各アクティビティ タイプがあるかどうかを決定します
Dim hasAppointments As Boolean = Me.ultraCalendarInfo1.GetAppointmentsInRange(DateTime.Today.Date.AddHours(9.0F), DateTime.Today.Date.AddHours(9.5F)).Count > 0
Dim hasHolidays As Boolean = Me.ultraCalendarInfo1.GetHolidaysInRange(DateTime.Today.Date, DateTime.Today.Date).Count > 0
Dim hasNotes As Boolean = Me.ultraCalendarInfo1.GetNotesInRange(DateTime.Today.Date, DateTime.Today.Date).Count > 0
' 現在の日のアクティビティの状態を表示します
Dim info As String = String.Empty
If (Not hasAppointments And Not hasHolidays And Not hasNotes) Then
info += "There are no Appointments, Holidays, or Notes for " + DateTime.Today.ToLongDateString() + "." + vbCrLf
Else
If (hasAppointments) Then
info += "There are Appointments scheduled for " + DateTime.Today.ToLongDateString() + "." + vbCrLf
If (hasHolidays) Then
info += "There are Holidays that fall on " + DateTime.Today.ToLongDateString() + "." + vbCrLf
If (hasNotes) Then
info += "There are Notes for " + DateTime.Today.ToLongDateString() + "." + vbCrLf
End If
End If
End If
End If
MessageBox.Show(info, "GetAppointmentsInRange/GetHolidaysInRange/GetNotesInRange", MessageBoxButtons.OK)
End Sub