MFC修改全局字体

来源:互联网 发布:帝国时代2网络对战 编辑:程序博客网 时间:2024/05/29 10:47

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);


0 0
原创粉丝点击