CFontDialog::m_cf
대화 상자 개체의 특성 멤버를 저장 하는 구조입니다.
CHOOSEFONT m_cf;
설명
생성 후에 CFontDialog 개체를 사용할 수 있습니다 m_cf 다양 한 대화 상자를 호출 하기 전에 수정 하는 DoModal 멤버 함수. 이 구조에 대 한 자세한 내용은 CHOOSEFONT 에 있는 Windows SDK.
예제
// The code fragment creates a font based on the information
// we got from CFontDialog::m_cf variable.
CFontDialog dlg;
if (dlg.DoModal() == IDOK)
{
// Create the font using the selected font from CFontDialog.
LOGFONT lf;
memcpy(&lf, dlg.m_cf.lpLogFont, sizeof(LOGFONT));
CFont font;
VERIFY(font.CreateFontIndirect(&lf));
// Do something with the font just created...
CClientDC dc(this);
CFont* def_font = dc.SelectObject(&font);
dc.TextOut(5, 5, _T("Hello"), 5);
dc.SelectObject(def_font);
// Done with the font. Delete the font object.
font.DeleteObject();
}
요구 사항
헤더: afxdlgs.h