CMonthCalCtrl::SetFirstDayOfWeek

更新 : 2007 年 11 月

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

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

パラメータ

  • iDay
    週の開始曜日として設定する曜日を示す整数値。曜日番号で指定します。曜日番号の詳細については、「GetFirstDayOfWeek」を参照してください。

  • lpnOld
    以前の週開始曜日を受け取る整数値へのポインタ。

戻り値

週の開始曜日の設定値がコントロール パネルの設定値 (LOCALE_IFIRSTDAYOFWEEK 値) と異なる場合は 0 以外を返します。それ以外の場合は 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);

必要条件

ヘッダー : afxdtctl.h

参照

参照

CMonthCalCtrl クラス

階層図

CMonthCalCtrl::GetFirstDayOfWeek

その他の技術情報

CMonthCalCtrl のメンバ