Creates a date field control or a month calendar control and attaches it to the CSftDate or CSftCalendar object.
C++
BOOL CSftDate::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); BOOL CSftCalendar::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
dwStyle
Specifies the window style of the control, usually WS_CHILD | WS_VISIBLE | WS_TABSTOP, optionally with WS_BORDER for the month calendar control.
rect
Specifies the size and position of the control, in client coordinates of pParentWnd.
pParentWnd
Specifies the parent window, usually a dialog or a CView. It must not be NULL.
nID
Specifies the control's ID.
The return value is TRUE if the control was created, otherwise FALSE.
A CSftDate or CSftCalendar object is constructed in two steps. First the constructor is called, then Create, which creates the control window (window class SFTDATE_CLASS or SFTCALENDAR_CLASS) and attaches it to the object.
A control defined in a dialog resource is attached to its object using DDX_Control or SubclassDlgItem instead (see Using C++/MFC).
By default the controls size themselves (SetAutoSize): a date field control keeps the height its font requires, a month calendar control takes the size of the months it shows.
See Also C/C++ API | Categories | Notifications