다음을 통해 공유


CDateTimeCtrl::SetMonthCalFont

날짜 및 시간 선택 컨트롤의 자식 컨트롤을 사용 하는 글꼴을 설정 합니다.

void SetMonthCalFont( 
   HFONT hFont, 
   BOOL bRedraw = TRUE  
);

매개 변수

  • hFont
    처리 하는 글꼴을 설정 합니다.

  • bRedraw
    컨트롤 바로 글꼴 설정에 따라 그려야 합니다 여부를 지정 합니다. 이 매개 변수를 설정 TRUE 컨트롤을 그리도록 합니다.

설명

이 멤버 함수는 Win32 메시지의 동작을 구현 DTM_SETMCFONT에 설명 된 대로, 여 Windows SDK.

예제

// 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);
}

참고

이 코드를 사용 하는 경우의 멤버로 사용할 사용자 CDialog-파생 클래스 라는 m_MonthFont 형식의 CFont.

요구 사항

헤더: afxdtctl.h

참고 항목

참조

CDateTimeCtrl 클래스

계층 구조 차트

CDateTimeCtrl::GetMonthCalFont