バージョン

GetWeekNumberForFirstDayOfMonth メソッド

特定の月の最初の日の週番号を返します。
シンタックス
'宣言
 
Public Function GetWeekNumberForFirstDayOfMonth( _
   ByVal month As Integer, _
   ByVal year As Integer _
) As Integer
public int GetWeekNumberForFirstDayOfMonth( 
   int month,
   int year
)

パラメータ

month
月番号
year
年番号

戻り値の型

WeekRuleFirstDayOfWeekResolved に基づいて指定された月と年の最初の日の週番号。
使用例
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

        Dim weekNumberFirstDayInMonth As Integer
        Dim weekNumberLastDayInMonth As Integer

        '	現在の月の最初の日および最終日の週番号を取得します
        weekNumberFirstDayInMonth = Me.ultraCalendarInfo1.GetWeekNumberForFirstDayOfMonth(DateTime.Today.Month, DateTime.Today.Year)
        weekNumberLastDayInMonth = Me.ultraCalendarInfo1.GetWeekNumberForLastDayOfMonth(DateTime.Today.Month, DateTime.Today.Year)

        '	情報をメッセージ ボックスに表示します
        Dim info As String = String.Empty
        info += "The week number of the first day in the current month is " + weekNumberFirstDayInMonth.ToString() + vbCrLf
        info += "The week number of the last day in the current month is " + weekNumberLastDayInMonth.ToString() + vbCrLf

        MessageBox.Show(info, "GetWeekNumberForFirstDayOfMonth/GetWeekNumberForLastDayOfMonth", 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)
		{

			int weekNumberFirstDayInMonth;
			int weekNumberLastDayInMonth;

			//	現在の月の最初の日および最終日の週番号を取得します
			weekNumberFirstDayInMonth = this.ultraCalendarInfo1.GetWeekNumberForFirstDayOfMonth( DateTime.Today.Month, DateTime.Today.Year );
			weekNumberLastDayInMonth = this.ultraCalendarInfo1.GetWeekNumberForLastDayOfMonth( DateTime.Today.Month, DateTime.Today.Year );

			//	情報をメッセージ ボックスに表示します
			string info = string.Empty;
			info += "The week number of the first day in the current month is " + weekNumberFirstDayInMonth.ToString() + "\n";
			info += "The week number of the last day in the current month is " + weekNumberLastDayInMonth.ToString() + "\n";

			MessageBox.Show( info, "GetWeekNumberForFirstDayOfMonth/GetWeekNumberForLastDayOfMonth", MessageBoxButtons.OK );

		}
参照