m_text.SetFont(pFont,True); Parameters pFont Specifies the new font. bRedraw If TRUE, redraw the CWnd object. Res If bRedraw is TRUE, the window will also be redrawn.
SetFont()可以改变字体及其大小。颜色不知道能不能改。LZ先试试,如果不行可修改其父窗口OnCtlColor()方法 添加 if (nCtlColor==CTLCOLOR_EDIT) { pDC->SetTextColor(你的颜色); }可改变字体颜色有分吗?
OnCtlColor()函数你知道吗?用classwizard让父对话框响应WM_CTLCOLOR消息,会出来这个方法。 在里面添上下面的代码 if (nCtlColor==CTLCOLOR_EDIT) { pDC->SetTextColor(你的颜色);// "你的颜色"是个COLORREF类型,查MSDN吧,没法再详细了 } 看得懂吗?哎,挣个小点数真不容易!!!我好可怜哦!_!
void SetFont(
CFont* pFont,
BOOL bRedraw = TRUE
);
Parameters
pFont
Specifies the new font.
bRedraw
If TRUE, redraw the CWnd object.
Res
If bRedraw is TRUE, the window will also be redrawn.
添加
if (nCtlColor==CTLCOLOR_EDIT)
{
pDC->SetTextColor(你的颜色);
}可改变字体颜色有分吗?
在里面添上下面的代码
if (nCtlColor==CTLCOLOR_EDIT)
{
pDC->SetTextColor(你的颜色);// "你的颜色"是个COLORREF类型,查MSDN吧,没法再详细了
}
看得懂吗?哎,挣个小点数真不容易!!!我好可怜哦!_!