Reputation: 123
I am trying to increase the font size for the title on the MainFrame. So far, I have tried several approaches without a good result. Any suggestions are welcome.
A. Approach 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);
}
It doesn't change a thing.
B. Approach 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);
}
This approach deletes all my ribbon menus and creates a lot of exceptions.
Upvotes: 0
Views: 1730
Reputation: 434
You may want to look at this: http://msdn.microsoft.com/en-us/library/windows/desktop/bb688195(v=vs.85).aspx
However, as Mark Ransom suggested it is not easy.
Upvotes: 1
Reputation: 29
The title bar is actually drawn and handled by the OS, program doesn't have a control over it. There is an OS wide setting to change it. Many applications use their own caption so that they can play around the styles of it.
Upvotes: 1