Version

Create Custom Date Buttons

You may find it necessary when using the WinCalenderCombo™ to add a DateButton that performs some custom action when clicked. For example, when the button is clicked it makes the selected date two days from the current date. The following example code shows how you could implement this functionality.

In Visual Basic:

Imports Infragistics.Win.UltraWinSchedule
...
Private Sub Create_Custom_Date_Buttons_Load(ByVal sender As Object, _
  ByVal e As System.EventArgs) Handles MyBase.Load
	Dim dateButton As CalendarCombo.DateButton
	dateButton = Me.UltraCalendarCombo1.DateButtons.Add("Custom", _
	  DateButtonType.Today, "2 days from now")
	dateButton.Type = DateButtonType.Custom
	dateButton.Date = DateTime.Today.AddDays(2)
End Sub

In C#:

using Infragistics.Win.UltraWinSchedule;
...
private void Create_Custom_Date_Buttons_Load(object sender, EventArgs e)
{
	Infragistics.Win.UltraWinSchedule.CalendarCombo.DateButton dateButton;
	dateButton = this.ultraCalendarCombo1.DateButtons.Add("Custom",
	  DateButtonType.Today, "2 days from now");
	dateButton.Type = DateButtonType.Custom;
	dateButton.Date = System.DateTime.Today.AddDays(2);
}