-
July 30th, 2014, 02:16 PM
#1
change menu bar font size
Can you change the menu bar font size in CMainFrame::OnCreate()? Here's what I have:
Code:
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
CRect rect;
GetClientRect(&rect);
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
{
return -1;
}
if (!m_wndToolBar.Create(this))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
m_font.CreatePointFont(165, "Arial");
m_wndToolBar.SetFont(&m_font);
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1;
}
return 0;
}
The line "m_wndToolBar.SetFont(&m_font);" does nothing. I found article on code guru http://www.codeguru.com/cpp/controls...ep-by-Step.htm. I will probably just use this if I can't make this work. But just wanted to ask. Thanks!!
-
July 30th, 2014, 04:21 PM
#2
Re: change menu bar font size
You either change the font in all menus that will be displayed in any application in your PC or you create an owner draw menu to change font only in this menu.
Victor Nijegorodov
-
August 1st, 2014, 06:06 PM
#3
Re: change menu bar font size
Originally Posted by VictorN
You either change the font in all menus that will be displayed in any application in your PC or you create an owner draw menu to change font only in this menu.
Ok, Thanks. I downloaded the demo project that I linked to in the OP and I'm just playing around with it to change the menu bar font. How would I change the menu bar font size in this demo application? I make my own font using "m_font.CreatePointFont(165, "Arial");". Then I try to set the font in OnCreate in the MainFrm.cpp, but the font doesn't change. Again thanks for the help!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|