Version

Action Property (DateButton)

Determines the action that occurs when the DateButton is pressed.
Syntax
'Declaration
 
Public Property Action As DateButtonAction
public DateButtonAction Action {get; set;}
Example
This example adds custom date buttons to the control's dropdown calendar for yesterday and tommorow, and customizes their appearance.

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
using Infragistics.Win;
using Infragistics.Win.UltraWinSchedule;
using Infragistics.Win.UltraWinSchedule.CalendarCombo;

		private void AddCustomDateButtons()
		{

			//	Create two DateButton objects, one for yesterday, and one for tomorrow
			DateButton yesterday = new DateButton();
			DateButton tomorrow = 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
			this.ultraCalendarCombo1.DateButtons.Add( yesterday );
			this.ultraCalendarCombo1.DateButtons.Add( tomorrow );

			//	Set the foreground and background colors for all date buttons
			this.ultraCalendarCombo1.DateButtonAppearance.BackColor = Color.LightBlue;
			this.ultraCalendarCombo1.DateButtonAppearance.ForeColor = Color.DarkBlue;

			//	Set the background color for the area in which the date buttons are displayed
			this.ultraCalendarCombo1.DateButtonAreaAppearance.BackColor = Color.AntiqueWhite;

			//	Make the DateButtonArea visible
			this.ultraCalendarCombo1.DateButtonAreaVisible = true;

		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also