Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
Imports Infragistics.Win.UltraWinSchedule.CalendarCombo
Private Sub LockEditPortionIfNotCurrentMonth()
'--------------------------------------------------------------------------------
' ReadOnly
' Value
'
' This example makes the edit portion of the control read-only if the
' selected date does not fall in the current month
'--------------------------------------------------------------------------------
' If the value is null, make the edit portion read-only
If (Me.ultraCalendarCombo1.Value Is Nothing) Then
Me.ultraCalendarCombo1.ReadOnly = True
Else
Try
' If the not in the current month, make the edit portion read-only
Dim dateValue As DateTime = Me.ultraCalendarCombo1.Value
If (dateValue.Month <> DateTime.Today.Month) Then
Me.ultraCalendarCombo1.ReadOnly = True
Else
Me.ultraCalendarCombo1.ReadOnly = False
End If
Catch
Me.ultraCalendarCombo1.ReadOnly = False
End Try
End If
End Sub