Imports System.Diagnostics
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
Private Sub GetMonthInfo()
' Create a month object for the current month
Dim month As Infragistics.Win.UltraWinSchedule.Month = Me.ultraCalendarInfo1.GetMonth(DateTime.Today)
Dim info As String = String.Empty
' Display the number of days in the month
info += "The month has " + month.DaysInMonth.ToString() + " days." + vbCrLf
' Display whether the week's Enabled property is true or false
If (month.Enabled) Then
info += "The month's Enabled property is set to true." + vbCrLf
Else
info += "The month's Enabled property is set to false." + vbCrLf
End If
' Display whether the month is effectively enabled
'
' Note that the EnabledResolved property accounts
' not only for the month's own Enabled property, but for the
' Enabled properties of all objects that encompass that month
' (i.e., Year)
If (month.EnabledResolved) Then
info += "The month is enabled." + vbCrLf
Else
info += "The month is disabled." + vbCrLf
End If
' If there is activity, display the number of each type
If (month.HasActivity) Then
Dim activity As String = String.Empty
If (month.Appointments.Count > 0) Then
activity += month.Appointments.Count.ToString() + " Appointment(s)" + vbCrLf
End If
If (month.Holidays.Count > 0) Then
activity += month.Holidays.Count.ToString() + " Holiday(s)" + vbCrLf
End If
If (month.Notes.Count > 0) Then
activity += month.Notes.Count.ToString() + " Note(s)" + vbCrLf
End If
info += "There is activity for the month :" + vbCrLf
info += activity + vbCrLf
End If
' Display the month and year number
Dim monthNumber As Integer
Dim yearNumber As Integer
monthNumber = month.MonthNumber
yearNumber = month.Year.YearNumber
info += "The month is month number " + monthNumber.ToString() + " of the year " + yearNumber.ToString() + vbCrLf
' Display the information
MessageBox.Show(info, "GetMonthInfo")
End Sub