您的位置:首页 > 其它

MFC修改全局字体

2014-06-19 10:02 211 查看
BOOL CXXXApp::InitInstance() 中加入如下代码:

#include<AfxGlobals.h>
//设置正常字体
LOGFONT lf;
afxGlobalData.fontRegular.GetLogFont(&lf);
afxGlobalData.fontRegular.DeleteObject();
lf.lfHeight = -12;
lstrcpy(lf.lfFaceName, _T("宋体"));
afxGlobalData.fontRegular.CreateFontIndirect(&lf);

//设置加粗的字体
afxGlobalData.fontBold.GetLogFont(&lf);
afxGlobalData.fontBold.DeleteObject();
lf.lfHeight = -12;
lstrcpy(lf.lfFaceName, _T("宋体"));
afxGlobalData.fontBold.CreateFontIndirect(&lf);

afxGlobalData.fontTooltip.GetLogFont(&lf);
afxGlobalData.fontTooltip.DeleteObject();
lf.lfHeight = -12;
lstrcpy(lf.lfFaceName, _T("宋体"));
afxGlobalData.fontTooltip.CreateFontIndirect(&lf);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: