バージョン

WeekHeaderClicked イベント

Week ヘッダーがクリックされたときに発生します。
シンタックス
'宣言
 
Public Event WeekHeaderClicked As WeekHeaderClickedEventHandler
public event WeekHeaderClickedEventHandler WeekHeaderClicked
イベント データ

イベント ハンドラが、このイベントに関連するデータを含む、WeekHeaderClickedEventArgs 型の引数を受け取りました。次の WeekHeaderClickedEventArgs プロパティには、このイベントの固有の情報が記載されます。

プロパティ解説
SelectWeek Week が選択されるかどうかを取得または設定します。
Week クリックされたヘッダーと関連づけられた Week オブジェクトを返します。
使用例
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        '	Set the WeekHeaderDisplayStyle property to 'WeekNumber'
        Me.ultraMonthViewSingle1.WeekHeaderDisplayStyle = WeekHeaderDisplayStyle.WeekNumber
    End Sub


    Private Sub ultraMonthViewSingle1_WeekHeaderClicked(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinSchedule.WeekHeaderClickedEventArgs) Handles ultraMonthViewSingle1.WeekHeaderClicked
        Dim monthViewSingle As UltraMonthViewSingle = sender

        '	Set the 'SelectWeek' property of the event arguments to false
        '	so that the default selection does not take place
        e.SelectWeek = False

        '	Get the first day of the week displayed by the control
        Dim dayOfWeek As System.DayOfWeek = monthViewSingle.FirstVisibleDay.Date.DayOfWeek

        '	Get the first day of the week
        Dim firstDayInWeek As DateTime = e.Week.FirstDate

        '	Walk either backward or forward to the get the first day
        '	in the same week displayed by the control
        Dim sign As Double = IIf(dayOfWeek > firstDayInWeek.DayOfWeek, 1.0F, -1.0F)

        While (firstDayInWeek.DayOfWeek <> dayOfWeek)

            firstDayInWeek = firstDayInWeek.AddDays(sign)
        End While

        '	Select the week
        monthViewSingle.CalendarInfo.SelectedDateRanges.Clear()
        monthViewSingle.CalendarInfo.SelectedDateRanges.Add(firstDayInWeek, firstDayInWeek.AddDays(6.0F))

    End Sub
using Infragistics.Win;
using Infragistics.Win.UltraWinSchedule;
using System.Diagnostics;

		private void button1_Click(object sender, System.EventArgs e)
		{
			//	Set the WeekHeaderDisplayStyle property to 'WeekNumber'
			this.ultraMonthViewSingle1.WeekHeaderDisplayStyle = WeekHeaderDisplayStyle.WeekNumber;
		}

		private void ultraMonthViewSingle1_WeekHeaderClicked(object sender, Infragistics.Win.UltraWinSchedule.WeekHeaderClickedEventArgs e)
		{
			UltraMonthViewSingle monthViewSingle = sender as UltraMonthViewSingle;

			//	Set the 'SelectWeek' property of the event arguments to false
			//	so that the default selection does not take place
			e.SelectWeek = false;

			//	Get the first day of the week displayed by the control
			System.DayOfWeek dayOfWeek = monthViewSingle.FirstVisibleDay.Date.DayOfWeek;

			//	Get the first day of the week
			DateTime firstDayInWeek = e.Week.FirstDate;

			//	Walk either backward or forward to the get the first day
			//	in the same week displayed by the control
			double sign = dayOfWeek > firstDayInWeek.DayOfWeek ? 1f : -1f;

			while ( firstDayInWeek.DayOfWeek != dayOfWeek )
			{
				firstDayInWeek = firstDayInWeek.AddDays( sign );
			}

			//	Select the week
			monthViewSingle.CalendarInfo.SelectedDateRanges.Clear();
			monthViewSingle.CalendarInfo.SelectedDateRanges.Add( firstDayInWeek, firstDayInWeek.AddDays(6f) );

		}
参照