MFC control (11): month calendar Control

Source: Internet
Author: User

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;

}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.