CMonthCalCtrl Class

Encapsulates the functionality of a month calendar control.

class CMonthCalCtrl : public CWnd

Members

Public Constructors

Name

Description

CMonthCalCtrl::CMonthCalCtrl

Constructs a CMonthCalCtrl object.

Public Methods

Name

Description

CMonthCalCtrl::Create

Creates a month calendar control and attaches it to the CMonthCalCtrl object.

CMonthCalCtrl::GetCalendarBorder

Retrieves the width of the border of the current month calendar control.

CMonthCalCtrl::GetCalendarCount

Retrieves the number of calendars displayed in the current month calendar control.

CMonthCalCtrl::GetCalendarGridInfo

Retrieves information about the current month calendar control.

CMonthCalCtrl::GetCalID

Retrieves the calendar identifier for the current month calendar control.

CMonthCalCtrl::GetColor

Gets the color of a specified area of a month calendar control.

CMonthCalCtrl::GetCurrentView

Retrieves the view that is currently displayed by the current month calendar control.

CMonthCalCtrl::GetCurSel

Retrieves the system time as indicated by the currently-selected date.

CMonthCalCtrl::GetFirstDayOfWeek

Gets the first day of the week to be displayed in the leftmost column of the calendar.

CMonthCalCtrl::GetMaxSelCount

Retrieves the current maximum number of days that can be selected in a month calendar control.

CMonthCalCtrl::GetMaxTodayWidth

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

CMonthCalCtrl::GetMinReqRect

Retrieves the minimum size required to show a full month in a month calendar control.

CMonthCalCtrl::GetMonthDelta

Retrieves the scroll rate for a month calendar control.

CMonthCalCtrl::GetMonthRange

Retrieves date information representing the high and low limits of a month calendar control's display.

CMonthCalCtrl::GetRange

Retrieves the current minimum and maximum dates set in a month calendar control.

CMonthCalCtrl::GetSelRange

Retrieves date information representing the upper and lower limits of the date range currently selected by the user.

CMonthCalCtrl::GetToday

Retrieves the date information for the date specified as "today" for a month calendar control.

CMonthCalCtrl::HitTest

Determines which section of a month calendar control is at a given point on the screen.

CMonthCalCtrl::IsCenturyView

Indicates whether the current view of the current month calendar control is the century view.

CMonthCalCtrl::IsDecadeView

Indicates whether the current view of the current month calendar control is the decade view.

CMonthCalCtrl::IsMonthView

Indicates whether the current view of the current month calendar control is the month view.

CMonthCalCtrl::IsYearView

Indicates whether the current view of the current month calendar control is the year view.

CMonthCalCtrl::SetCalendarBorder

Sets the width of the border of the current month calendar control.

CMonthCalCtrl::SetCalendarBorderDefault

Sets the default width of the border of the current month calendar control.

CMonthCalCtrl::SetCalID

Sets the calendar identifier for the current month calendar control.

CMonthCalCtrl::SetCenturyView

Sets the current month calendar control to display the century view.

CMonthCalCtrl::SetColor

Sets the color of a specified area of a month calendar control.

CMonthCalCtrl::SetCurrentView

Sets the current month calendar control to display the specified view.

CMonthCalCtrl::SetCurSel

Sets the currently selected date for a month calendar control.

CMonthCalCtrl::SetDayState

Sets the display for days in a month calendar control.

CMonthCalCtrl::SetDecadeView

Sets the current month calendar control to the decade view.

CMonthCalCtrl::SetFirstDayOfWeek

Sets the day of week to be displayed in the leftmost column of the calendar.

CMonthCalCtrl::SetMaxSelCount

Sets the maximum number of days that can be selected in a month calendar control.

CMonthCalCtrl::SetMonthDelta

Sets the scroll rate for a month calendar control.

CMonthCalCtrl::SetMonthView

Sets the current month calendar control to display the month view.

CMonthCalCtrl::SetRange

Sets the minimum and maximum allowed dates for a month calendar control.

CMonthCalCtrl::SetSelRange

Sets the selection for a month calendar control to a given date range.

CMonthCalCtrl::SetToday

Sets the calendar control for the current day.

CMonthCalCtrl::SetYearView

Sets the current month calendar control to year view.

CMonthCalCtrl::SizeMinReq

Repaints the month calendar control to its minimum, one-month size.

CMonthCalCtrl::SizeRectToMin

For the current month calendar control, calculates the smallest rectangle that can contain all the calendars that fit in a specified rectangle.

Remarks

The month calendar control provides the user with a simple calendar interface, from which the user can select a date. The user can change the display by:

  • Scrolling backward and forward, from month to month.

  • Clicking the Today text to display the current day (if the MCS_NOTODAY style is not used).

  • Picking a month or a year from a pop-up menu.

You can customize the month calendar control by applying a variety of styles to the object when you create it. These styles are described in Month Calendar Control Styles in the Windows SDK.

The month calendar control can display more than one month, and it can indicate special days (such as holidays) by bolding the date.

For more information on using the month calendar control, see Using CMonthCalCtrl.

Inheritance Hierarchy

CObject

CCmdTarget

CWnd

CMonthCalCtrl

Requirements

Header: afxdtctl.h

See Also

Reference

CWnd Class

Hierarchy Chart

CDateTimeCtrl Class

Concepts

MFC Sample CMNCTRL1