The UltraDateTimeEditor control provides the ability to restrict the range of dates that will be accepted by the control. This is accomplished by setting the MinDate and MaxDate properties.
Imports Infragistics.Win Imports Infragistics.Win.UltraWinEditors Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ' Set the MinDate property to the first day of the current year Dim minDate As DateTime = New DateTime(DateTime.Today.Year, 1, 1) ' Set the MaxDate property to the last day of the current year Dim maxDate As DateTime = New DateTime(DateTime.Today.Year, 12, 31) End Sub
using System.Diagnostics; using Infragistics.Win; using Infragistics.Win.UltraWinEditors; private void button1_Click(object sender, System.EventArgs e) { // Set the MinDate property to the first day of the current year DateTime minDate = new DateTime( DateTime.Today.Year, 1, 1 ); // Set the MaxDate property to the last day of the current year DateTime maxDate = new DateTime( DateTime.Today.Year, 12, 31 ); }
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