我正在尝试增加 MainFrame 上标题的字体大小。到目前为止,我已经尝试了几种方法,但没有一个好的结果。欢迎任何建议。
A. 方法 1
void CMainFrame::OnPaint()
{
CPaintDC dc(this); // device context for painting
LOGFONT lF;
lF.lfHeight = 10;
lF.lfWidth = 0;
lF.lfWeight = FW_NORMAL;
lF.lfItalic = FALSE; //TRUE;
lF.lfUnderline = FALSE; //TRUE;
lF.lfStrikeOut = FALSE; //TRUE;
lF.lfEscapement = 0;
lF.lfOrientation = 0;
_tcscpy_s(lF.lfFaceName, _T("Verdana"));
CFont m_font;
m_font.CreateFontIndirect(&lF);
SetFont(&m_font);
}
它不会改变任何事情。
B. 方法 2
void CMainFrame::OnPaint()
{
CPaintDC dc(this); // device context for painting
LOGFONT lF;
lF.lfHeight = 10;
lF.lfWidth = 0;
lF.lfWeight = FW_NORMAL;
lF.lfItalic = FALSE; //TRUE;
lF.lfUnderline = FALSE; //TRUE;
lF.lfStrikeOut = FALSE; //TRUE;
lF.lfEscapement = 0;
lF.lfOrientation = 0;
_tcscpy_s(lF.lfFaceName, _T("Verdana"));
CFont m_font;
m_font.CreateFontIndirect(&lF);
BOOL fRedraw = TRUE;
SendMessageToDescendants(WM_SETFONT, (WPARAM)m_font.m_hObject);
}
这种方法会删除我所有的功能区菜单并创建很多异常。