CDateTimeCtrl::GetMonthCalColor
检索月历的特定部分中的颜色为日期和时间选择器控件中。
COLORREF GetMonthCalColor(
int iColor
) const;
参数
- iColor
指定月历的哪颜色区域的 int 值检索。 有关值列表,选择 SetMonthCalColor请参见 iColor 参数。
返回值
表示设置为month calendar控件的指定部分中的颜色,如果成功的 COLORREF 值。 函数返回-1;如果不成功。
备注
此成员函数实现Win32消息 DTM_GETMCCOLOR的行为,如 Windows SDK所述。
示例
// Set the color for the text in the control and
// assure it was set properly. Unlike the GetMonthCalCtrl() member,
// GetMonthCalColor() and SetMonthCalColor() can be used at any time.
m_DateTimeCtrl.SetMonthCalColor(MCSC_TEXT, RGB(255, 0, 0));
VERIFY(m_DateTimeCtrl.GetMonthCalColor(MCSC_TEXT) == RGB(255, 0, 0));
要求
Header: afxdtctl.h