void CDialogDlg::OnDblClickCalendar1() { CString cSelectedDate; // Date selected by user char* cDay = " "; // Selected day char* cYear = " "; // Selected year // Get day from calendar control itoa(m_Calendar1.GetDay(), cDay, 10); cSelectedDate = cDay; // Get month from calendar control switch (m_Calendar1.GetMonth()) { case 1: cSelectedDate = cSelectedDate + " January "; break; case 2: cSelectedDate = cSelectedDate + " February "; break; case 3: cSelectedDate = cSelectedDate + " March "; break; case 4: cSelectedDate = cSelectedDate + " April "; break; case 5: cSelectedDate = cSelectedDate + " May "; break; case 6: cSelectedDate = cSelectedDate + " June "; break; case 7: cSelectedDate = cSelectedDate + " July "; break; case 8: cSelectedDate = cSelectedDate + " August "; break; case 9: cSelectedDate = cSelectedDate + " September "; break; case 10: cSelectedDate = cSelectedDate + " October "; break; case 11: cSelectedDate = cSelectedDate + " November "; break; case 12: cSelectedDate = cSelectedDate + " December "; break; } // Get the year itoa(m_Calendar1.GetYear(), cYear, 10); cSelectedDate = cSelectedDate + cYear; // Display the date AfxMessageBox("You doubleclicked on: " + cSelectedDate, MB_OK | MB_ICONINFORMATION, 0); }