怎样在我的普通编辑窗口中重设字体?
我是这样设置的:
void CTestView::OnSetFont()
{
CFontDialog FontDlg;
if(FontDlg.DoModal() == IDOK)
{
LOGFONT MyLogFont;
FontDlg.GetCurrentFont(&MyLogFont);
CFont MyFont;
MyFont.CreateFont(MyLogFont.lfHeight, MyLogFont.lfWidth,
MyLogFont.lfOrientation,
MyLogFont.lfOrientation,
MyLogFont.lfWeight,
MyLogFont.lfItalic,
MyLogFont.lfUnderline,
MyLogFont.lfStrikeOut,
MyLogFont.lfCharSet,
MyLogFont.lfOutPrecision,
MyLogFont.lfClipPrecision,
MyLogFont.lfQuality,
MyLogFont.lfPitchAndFamily,
MyLogFont.lfFaceName);
SetFont(&MyFont,TRUE);
}
}
调用该函数后,输入时似乎很对,但是退格时出现稀奇古怪的事:字体变成了原样。
这样可以吗?