'Declaration Public Function GetClosestSelectableDate( _ ByVal startDate As Date, _ ByVal direction As ClosestDayToReturn, _ ByRef closestDate As Date _ ) As Boolean
public bool GetClosestSelectableDate( DateTime startDate, ClosestDayToReturn direction, ref DateTime closestDate )
In order for a Day to be selectable, the date must be enabled and must be within the MinDate and MaxDate. A date is enabled, if the date specific objects (e.g. Day, Week, Month, etc.) are enabled and the general objects are enabled (e.g. DayOfWeek, MonthOfYear, etc.).
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 ); }
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