CMonthCalCtrl::GetMaxTodayWidth

检索最大的宽度“today”为当前month calendar控件的字符串。

DWORD GetMaxTodayWidth() const;

返回值

宽度的“today”字符串,以像素为单位。

示例

下面的代码示例定义任何变量,m_monthCalCtrl,用于以编程方式访问month calendar控件。 此变量在下一个示例。

    // Variable used to reference the month calendar control.
    CMonthCalCtrl m_monthCalCtrl;
    // Variable used to reference the splitbutton control.
    CSplitButton m_splitButton;

下面的代码示例演示 GetMaxTodayWidth 方法。

    DWORD width = m_monthCalCtrl.GetMaxTodayWidth();
    CString str;
    str.Format(_T("The maximum today width is %d."), width);
    AfxMessageBox(str, MB_ICONINFORMATION);

备注

用户可以返回到当前日期通过单击“today”字符串,显示在月历控件的底部。 “today”字符串包含标签文本和日期文本。

此方法发送 MCM_GETMAXTODAYWIDTH 信息,在 Windows SDK所述。

要求

标头: afxdtctl.h

请参见

参考

CMonthCalCtrl选件类

层次结构图

MCM_GETMAXTODAYWIDTH