This control is quite similar to the date time picker control. It should actually be the date time picker that integrates it, and it only comes out when it is clicked.
The month control is directly displayed on the page. Of course, it has other different settings.
Currently, you can set the selected item to obtain the selected date.
Set the selected items by default
If no date is selected by default, how can we specify a date.
Cmonthcalctrl m_montctrl;
Ddx_control (PDX, idc_monthcalendar1, m_montctrl );
M_montctrl.Setcursel(Ctime (, 0, 0); // specify 2008/8/8
Obtain the selected date
// Use the following message to process the selected date in the control:
On_notify (mcn_selchange, idc_monthcalendar1, onmcnselchangemonthcalendar1)
VoidCmfc_ctrl_timedlg: onmcnselchangemonthcalendar1 (nmhdr * pnmhdr, lresult * presult)
{
Lpnmselchange pselchange =Reinterpret_cast<Lpnmselchange> (pnmhdr );
Ctime month;
M_montctrl.getcursel (month );// Obtain the current date information
// Perform other operations based on the date information, such as displaying different page information
* Presult = 0;
}