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 ' 現在の年に対応する Year オブジェクトを取得します Dim year As Infragistics.Win.UltraWinSchedule.Year year = Me.ultraCalendarInfo1.GetYear(DateTime.Today.Year) ' 年がうるう年かどうかを決定するには、Year オブジェクトの IsLeapYear プロパティを使用します If (year.IsLeapYear) Then MessageBox.Show("The current year, " + year.YearNumber + " is a leap year.", "GetYear", MessageBoxButtons.OK) Else MessageBox.Show("The current year, " + year.YearNumber + " is not a leap year.", "GetYear", MessageBoxButtons.OK) End If 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) { // 現在の年に対応する Year オブジェクトを取得します Infragistics.Win.UltraWinSchedule.Year year = null; year = this.ultraCalendarInfo1.GetYear( DateTime.Today.Year ); // 年がうるう年かどうかを決定するには、Year オブジェクトの IsLeapYear プロパティを使用します if ( year.IsLeapYear ) MessageBox.Show( "The current year, " + year.YearNumber + " is a leap year.", "GetYear", MessageBoxButtons.OK ); else MessageBox.Show( "The current year, " + year.YearNumber + " is not a leap year.", "GetYear", MessageBoxButtons.OK ); }