请问,首先是否应添加一个EDIT Type 的变量 m_text,然后应该如何修改m_text的字体大小和颜色?

解决方案 »

  1.   

    调用setFont方法就可以了
    void SetFont(
       CFont* pFont,
       BOOL bRedraw = TRUE 
    );
      

  2.   

    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.
      

  3.   

    SetFont()可以改变字体及其大小。颜色不知道能不能改。LZ先试试,如果不行可修改其父窗口OnCtlColor()方法
    添加
        if (nCtlColor==CTLCOLOR_EDIT)
        {
    pDC->SetTextColor(你的颜色);
        }可改变字体颜色有分吗?
      

  4.   

    OnCtlColor()函数你知道吗?用classwizard让父对话框响应WM_CTLCOLOR消息,会出来这个方法。
    在里面添上下面的代码
    if (nCtlColor==CTLCOLOR_EDIT)
    {
        pDC->SetTextColor(你的颜色);// "你的颜色"是个COLORREF类型,查MSDN吧,没法再详细了
    }
    看得懂吗?哎,挣个小点数真不容易!!!我好可怜哦!_!