CMonthCalCtrl::GetMaxTodayWidth

Retrieves the maximum width of the "Today" string for the current month calendar control.

DWORD GetMaxTodayWidth() const;

Return Value

The width of the "Today" string, in pixels.

Example

The following code example defines the variable, m_monthCalCtrl, that is used to programmatically access the month calendar control. This variable is used in the next example.

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

The following code example demonstrates the GetMaxTodayWidth method.

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

Remarks

The user can return to the current date by clicking the "Today" string, which is displayed at the bottom of the month calendar control. The "Today" string includes label text and date text.

This method sends the MCM_GETMAXTODAYWIDTH message, which is described in the Windows SDK.

Requirements

Header: afxdtctl.h

See Also

Reference

CMonthCalCtrl Class

Hierarchy Chart

MCM_GETMAXTODAYWIDTH