UltraDateTimeEditorコントロールは、コントロールが受け入れる値の範囲を制限する機能を提供します。これは、 MaxDate プロパティとMinDateプロパティを設定することによって行います。
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 ); }