CMonthCalCtrl::SetFirstDayOfWeek

カレンダーの左端の列に表示する週間の日付を設定します。

BOOL SetFirstDayOfWeek(
   int iDay,
   int* lpnOld = NULL 
);

パラメーター

  • iDay
    整数値の日、週の開始曜日をとして設定する必要があるか表現。この値は、日付数字の 1 種類があります。日付数字については、GetFirstDayOfWeek を参照してください。

  • lpnOld
    最初の日を示す整数へのポインターは、以前に設定します。

戻り値

前の曜日最初の日である LOCALE_IFIRSTDAYOFWEEKのそれ以外の値に設定されている場合は、コントロール パネルの設定で説明しました。それ以外の場合、この関数は 0 を返します。

解説

このメンバー関数は Windows SDKに記述されている Win32 メッセージの動作を MCM_SETFIRSTDAYOFWEEK実行します。

使用例

// This work isn't normally necessary, since the control will set 
// the day of the week to match the system locale by itself.

// Ask the system for the first day of the week
TCHAR sz[2];
GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_IFIRSTDAYOFWEEK, sz, 2);

// Convert from string result
int nFirstDay = _ttoi(sz);

// Set it and assert that it was successful.
m_calCtrl1.SetFirstDayOfWeek(nFirstDay);
ASSERT(m_calCtrl1.GetFirstDayOfWeek() == nFirstDay);

必要条件

Header: afxdtctl.h

参照

関連項目

CMonthCalCtrl クラス

階層図

CMonthCalCtrl::GetFirstDayOfWeek