300分在线等,救命啊,我如何改变MDI中主框架跟VIEW的默认字体大小啊。

kkbws 2005-07-19 09:01:36
我建立了一个多文档工程,一个LISTVIEW视图

老板说我这个程序的字体太小了,可这不是对话框我不知道该怎么改。求求高手指点一下。给出简单的源程序。非常感谢。

视继承自listview,取名为MyView;要求在初始化中将默认字体改大。
...全文
157 9 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
casinosun 2005-07-20
  • 打赏
  • 举报
回复
createfont就行了
windcsn 2005-07-20
  • 打赏
  • 举报
回复
也可以在OnCreate中重新设置字体
linur 2005-07-20
  • 打赏
  • 举报
回复
更正一下,字体放大2倍:
在你的MyView::OnInitialUpdate 中加入

LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
CFont *pFont = this->GetFont();
pFont->GetLogFont( &lf );
lf.lfHeight =lf.lfHeight *2; //放大
lf.lfWidth = lf.lfWidth *2;
HFONT hFont=::CreateFontIndirect(&lf);
::SendMessage(this->GetSafeHwnd(),WM_SETFONT,(WPARAM)hFont,TRUE);
linur 2005-07-20
  • 打赏
  • 举报
回复
字体放大2倍:
在你的MyView::OnInitialUpdate 中加入

LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
CFont *pFont = this->GetFont();
pFont->GetLogFont( &lf );
lf.lfHeight =lf.lfHeight *2; //放大
lf.lfWidth = lf.lfWidth *2;
HFONT hFont=::CreateFontIndirect(&lf);
::SendMessage(m_ColListCtrl.GetSafeHwnd(),WM_SETFONT,(WPARAM)hFont,TRUE);
goodboyws 2005-07-20
  • 打赏
  • 举报
回复
只对CMyView调用SetFont,其他的都没有意思
DentistryDoctor 2005-07-20
  • 打赏
  • 举报
回复
CMainFrame::OnCreate,
CChildView::OnInitialUpdate
中调用SetFont就可以了。
AntonlioX 2005-07-19
  • 打赏
  • 举报
回复
论坛里有旧帖子讲到了这个问题
http://search.csdn.net/Expert/topic/135/135599.xml?temp=.5064813
http://search.csdn.net/Expert/topic/135/135884.xml?temp=.97073
http://search.csdn.net/Expert/topic/2617/2617801.xml?temp=8.266628E-03
AntonlioX 2005-07-19
  • 打赏
  • 举报
回复
up
macro_c 2005-07-19
  • 打赏
  • 举报
回复
在你CMYView类中的初始化函数void CMditestView::OnInitialUpdate()中加入下列代码
CFont* p_ParentFont = new CFont;
VERIFY(p_ParentFont->CreateFont(
19, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
FW_NORMAL, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
"宋体")); // lpszFacename
}
this->SetFont(p_ParentFont);

15,980

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧