Version

ClosestDayToReturn Enumeration

Used to specify the direction of a search.
Syntax
'Declaration
 
Public Enum ClosestDayToReturn 
   Inherits System.Enum
public enum ClosestDayToReturn : System.Enum 
Members
MemberDescription
AfterThe closest item at or after the specified value.
BeforeThe closest item at or before the specified value.
BeforeOnOrAfterThe closest item will be returned.
BeforeOrAfterThe closest item (not including the item) to the value will be returned.
CurrentDayThe current item is checked.
OnOrAfterAny item from the current item and after is checked.
OnOrBeforeAny item from the current item or before is checked.
Example
This example uses the GetClosestSelectableDate method to get the first selectable date (i.e., visible and enabled) that falls on or after the current date.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
Imports System.IO
Imports System.Globalization

    Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click

        '	Get the the first selectable date (i.e., visible and enabled) that
        '	falls on or after the current date
        Dim selectableDate As DateTime = DateTime.Today
        Me.ultraCalendarInfo1.GetClosestSelectableDate(DateTime.Today, ClosestDayToReturn.OnOrAfter, selectableDate)

        '	Display the first selectable date to the end user
        MessageBox.Show("The first selectable day that falls on or after the current date is " + selectableDate.ToLongDateString() + "." + vbCrLf, "GetClosestSelectableDate", MessageBoxButtons.OK)

    End Sub
using System.Diagnostics;
using Infragistics.Win;
using Infragistics.Win.UltraWinSchedule;
using System.IO;
using System.Globalization;

		private void button1_Click(object sender, System.EventArgs e)
		{
			
			//	Get the the first selectable date (i.e., visible and enabled) that
			//	falls on or after the current date
			DateTime selectableDate = DateTime.Today;
			this.ultraCalendarInfo1.GetClosestSelectableDate( DateTime.Today, ClosestDayToReturn.OnOrAfter, ref selectableDate );

			//	Display the first selectable date to the end user
			MessageBox.Show( "The first selectable day that falls on or after the current date is " + selectableDate.ToLongDateString() + "." + "\n", "GetClosestSelectableDate", MessageBoxButtons.OK );

		}
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