- Notifications
You must be signed in to change notification settings - Fork 961
/
Copy pathcdatetimectrl-class_11.cpp
23 lines (20 loc) · 765 Bytes
/
cdatetimectrl-class_11.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// The following code example would most likely appear
// in the OnInitDialog function of your dialog class.
// It creates a font (Arial, 10 pixels high) and if successful,
// stores the result in m_MonthFont, a member of your
// dialog class declared as follows:
// CFont m_MonthFont;
// SetMonthCalFont is then called passing in the new font,
// causing the month calendar control to display all
// text and dates with an Arial font.
//initializing the necessary members of the LOGFONT
// structure
LOGFONT lf;
memset(&lf, 0, sizeof(lf));
lf.lfHeight = 10;
_tcscpy_s(lf.lfFaceName, LF_FACESIZE, _T("Arial"));
if (m_MonthFont.CreateFontIndirect(&lf))
{
// if successful, set the month calendar font
m_DateTimeCtrl.SetMonthCalFont((HFONT)m_MonthFont);
}