CDateTimeCtrl::SetMonthCalFont
Nastaví písmo, které bude používat data a času pro výběr ovládacího prvku podřízeného prvku měsíční kalendář.
void SetMonthCalFont(
HFONT hFont,
BOOL bRedraw = TRUE
);
Parametry
hFont
Zpracování na písmo, který bude nastaven.bRedraw
Určuje, zda ovládací prvek by překreslit ihned po nastavení písma.Nastavení tohoto parametru na TRUE způsobuje překreslit ovládací prvek.
Poznámky
Členské funkce implementuje chování zprávy Win32 DTM_SETMCFONT, jak je popsáno v .
Příklad
// 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);
}
[!POZNÁMKA]
Pokud použijete tento kód, budete chtít vytvořit člen vaší CDialog -odvozené třídy nazvané m_MonthFont typu CFont.
Požadavky
Záhlaví: afxdtctl.h