Version

GetWeek(Int32,Int32) Method

Returns a Week object for a specified week and year.
Syntax
'Declaration
 
Public Overloads Function GetWeek( _
   ByVal week As Integer, _
   ByVal year As Integer _
) As Week
public Week GetWeek( 
   int week,
   int year
)

Parameters

week
Week number
year
Year number

Return Value

A Week object for the specified week and year.
Example
This example uses the GetWeek method to obtain the number of the current week in its 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 week object corresponding to the current week
        Dim week As Week = Me.ultraCalendarInfo1.GetWeek(DateTime.Today)

        '	Display the number of the current week
        MessageBox.Show("The number of the current week is " + week.WeekNumber.ToString(), "GetWeek", 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 week object corresponding to the current week
			Week week = this.ultraCalendarInfo1.GetWeek( DateTime.Today );

			//	Display the number of the current week
			MessageBox.Show( "The number of the current week is " + week.WeekNumber.ToString(), "GetWeek", 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