MFC类CEditView字体大小

时间:2020-03-30 07:07:48

标签: c++ mfc

我使用CEditView创建Visual Studio(MFC)和多个文档。

如何在CEditView中更改字体大小?

enter image description here

1 个答案:

答案 0 :(得分:0)

以下是示例:

CFont* pFont = _ed.GetFont();
LOGFONT LogFont;
pFont->GetLogFont(&LogFont);

CFont* NewFont = new CFont();
// lstrcpy( LogFont.lfFaceName, _T("Times New Roman CE" ));
LogFont.lfHeight = 8;
NewFont->CreateFontIndirect(&LogFont);
_ed.SetFont(NewFont );