Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
Imports Infragistics.Win.UltraWinSchedule.CalendarCombo
Private Sub AddCustomDateButtons()
' Create two DateButton objects, one for yesterday, and one for tomorrow
Dim yesterday As DateButton = New DateButton()
Dim tomorrow As DateButton = New DateButton()
' Set the Date property for each button
yesterday.Date = DateTime.Today.AddDays(-1.0F)
tomorrow.Date = DateTime.Today.AddDays(1.0F)
' Set the Action property for each button
yesterday.Action = DateButtonAction.SelectDay
tomorrow.Action = DateButtonAction.SelectDay
' Set the Caption for each button
yesterday.Caption = "Yesterday"
tomorrow.Caption = "Tomorrow"
' Set the Key for each button
yesterday.Key = "ID_" + yesterday.Date.ToShortDateString()
tomorrow.Key = "ID_" + tomorrow.Date.ToShortDateString()
' Set the ToolTip for each button
yesterday.ToolTip = "Selects and activates the day prior to the current day"
tomorrow.ToolTip = "Selects and activates the day following the current day"
' Set the Visible property for each button
yesterday.Visible = True
tomorrow.Visible = True
' Set the Type property for each button to Custom
yesterday.Type = DateButtonType.Custom
tomorrow.Type = DateButtonType.Custom
' Add the custom date buttons to the control's DateButtons collection
Me.ultraCalendarCombo1.DateButtons.Add(yesterday)
Me.ultraCalendarCombo1.DateButtons.Add(tomorrow)
' Set the foreground and background colors for all date buttons
Me.ultraCalendarCombo1.DateButtonAppearance.BackColor = Color.LightBlue
Me.ultraCalendarCombo1.DateButtonAppearance.ForeColor = Color.DarkBlue
' Set the background color for the area in which the date buttons are displayed
Me.ultraCalendarCombo1.DateButtonAreaAppearance.BackColor = Color.AntiqueWhite
' Make the DateButtonArea visible
Me.ultraCalendarCombo1.DateButtonAreaVisible = True
End Sub