Поделиться через


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

Требования

Header: afxdlgs.h

См. также

Ссылки

Класс CFontDialog

Диаграмма иерархии