Creates a Windows control and performs additional initializations.
- Returns
- Nonzero if control has been created successfully; otherwise FALSE.
Call this method to create dialog control.
This method requires definition of the rectangle in dialog client coordinates where the window is to be created. The following manner of designing dialog containing calendar bar is recommended:
- Add member variable of type CBCGPCalendarBar (for example named m_calendarBar) in the dialog class.
- In dialog template put static control on the place of calendar bar and set it invisible.
- In the dialog OnInitDialog () method get static rectangle and call m_calendarBar .CreateControl(..) method.
- Parameters
-
pParentWnd | The parent window |
rect | The window rectangle in dialog client coordinates. |
nID | The command ID. |
enableSelection | Enable/disable multiple selection. If TRUE, the multiple selection is enabled. |
dwStyle | The window style. |
Example:
{
...
CStatic m_calendarLocation;
};
BOOL CPage6::OnInitDialog()
{
.....
CRect rectCalendar;
m_calendarLocation.GetClientRect (&rectCalendar);
m_calendarLocation.MapWindowPoints (this, &rectCalendar);
m_wndCalendarCtrl.
CreateControl(
this, rectCalendar, (UINT)-1,
true);
....
}