HeaderPane
Main
Hide
Share Link
Print

Create

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);

Parameters

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.

Returns

The return value is TRUE if the control was created, otherwise FALSE.

Comments

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


Last Updated 11/26/2026 - (email)
© 2026 Softel vdm, Inc.