Share via


CDateTimeCtrl Class

Encapsulates the functionality of a date and time picker control.

class CDateTimeCtrl : public CWnd

Members

Public Constructors

Name

Description

CDateTimeCtrl::CDateTimeCtrl

Constructs a CDateTimeCtrl object.

Public Methods

Name

Description

CDateTimeCtrl::CloseMonthCal

Closes the current date and time picker control.

CDateTimeCtrl::Create

Creates the date and time picker control and attaches it to the CDateTimeCtrl object.

CDateTimeCtrl::GetDateTimePickerInfo

Retrieves information about the current date and time picker control.

CDateTimeCtrl::GetIdealSize

Returns the ideal size of the date and time picker control that is required to display the current date or time.

CDateTimeCtrl::GetMonthCalColor

Retrieves the color for a given portion of the month calendar within the date and time picker control.

CDateTimeCtrl::GetMonthCalCtrl

Retrieves the CMonthCalCtrl object associated with the date and time picker control.

CDateTimeCtrl::GetMonthCalFont

Retrieves the font currently used by the date and time picker control's child month calendar control.

CDateTimeCtrl::GetMonthCalStyle

Gets the style of the current date and time picker control.

CDateTimeCtrl::GetRange

Retrieves the current minimum and maximum allowed system times for a date and time picker control.

CDateTimeCtrl::GetTime

Retrieves the currently selected time from a date and time picker control and puts it in a specified SYSTEMTIME structure.

CDateTimeCtrl::SetFormat

Sets the display of a date and time picker control in accordance with a given format string.

CDateTimeCtrl::SetMonthCalColor

Sets the color for a given portion of the month calendar within a date and time picker control.

CDateTimeCtrl::SetMonthCalFont

Sets the font that the date and time picker control's child month calendar control will use.

CDateTimeCtrl::SetMonthCalStyle

Sets the style of the current date and time picker control.

CDateTimeCtrl::SetRange

Sets the minimum and maximum allowed system times for a date and time picker control.

CDateTimeCtrl::SetTime

Sets the time in a date and time picker control.

Remarks

The date and time picker control (DTP control) provides a simple interface to exchange date and time information with a user. This interface contains fields, each of which displays a part of the date and time information stored in the control. The user can change the information stored in the control by changing the content of the string in a given field. The user can move from field to field using the mouse or the keyboard.

You can customize the date and time picker control by applying a variety of styles to the object when you create it. See Date and Time Picker Control Styles in the Windows SDK for more information about styles specific to the date and time picker control. You can set the display format of the DTP control using format styles. These format styles are described under "Format Styles" in the Windows SDK topic Date and Time Picker Control Styles.

The date and time picker control also uses notifications and callbacks, which are described in Using CDateTimeCtrl.

Inheritance Hierarchy

CObject

CCmdTarget

CWnd

CDateTimeCtrl

Requirements

Header: afxdtctl.h

See Also

Reference

CWnd Class

Hierarchy Chart

CMonthCalCtrl Class

Concepts

MFC Sample CMNCTRL1