Version

GetYear Method

Returns a Year object for a specified year.
Syntax
'Declaration
 
Public Function GetYear( _
   ByVal year As Integer _
) As Year
public Year GetYear( 
   int year
)

Parameters

year
Year number

Return Value

A Year object corresponding with year.
Example
This example uses the GetYear method to obtain a Year object corresponding to the current year, and to determine whether the current year is a leap year.

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 Year object corresponding to the current year
        Dim year As Infragistics.Win.UltraWinSchedule.Year
        year = Me.ultraCalendarInfo1.GetYear(DateTime.Today.Year)

        '	Use the IsLeapYear property of the Year object to determine whether the year is a leap year		
        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)
		{

			//	Get the Year object corresponding to the current year
			Infragistics.Win.UltraWinSchedule.Year year = null;
			year = this.ultraCalendarInfo1.GetYear( DateTime.Today.Year );

			//	Use the IsLeapYear property of the Year object to determine whether the year is a leap year		
			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 );

		}
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