Share via


CFontDialog::GetCurrentFont

呼叫此函式將目前選取的字型的特性對於 LOGFONT 結構的成員。

void GetCurrentFont( 
   LPLOGFONT lplf  
);

參數

  • lplf
    LOGFONT 結構的指標。

備註

提供其他 CFontDialog 成員函式存取目前字型的個別的特性。

在 [ DoModal,的呼叫期間如果呼叫這個函式時,就會傳回目前的選取範圍 (哪些使用者在對話方塊中看到或變更)。 如果這個函式在 DoModal 對的呼叫 (在呼叫之後,才會傳回 DoModalIDOK),則會傳回所使用者實際選取。

範例

// Get the characteristics of the currently selected font, if any.
CFontDialog dlg;
if (dlg.DoModal() == IDOK)
{
   LOGFONT lf;
   dlg.GetCurrentFont(&lf);
   TRACE(_T("Face name of the selected font = %s\n"), lf.lfFaceName);
}

需求

Header: afxdlgs.h

請參閱

參考

CFontDialog 類別

階層架構圖表

CFontDialog::GetFaceName

CFontDialog::GetStyleName