假如:
CFont font;
font.CreateFontIndirect(&lf);//其中lf为新的字体结构(新的LOGFONT),则font为新字体那么,我应该在哪一个函数内写代码?使edit框内的代码(我爱你,中国)立即变为新的font字体?

解决方案 »

  1.   

    CEdit *m_Edit = (CEdit *)GetDlgItem(IDC_EDIT);
    m_Edit->SetFont(&font,TRUE);
      

  2.   

    CWnd类(CEdit的父类)的SetFont();
    在此函数中包含了更新的操作。
      

  3.   

    CWnd::SetFont
    This method sets the current font of the window to the specified font.void SetFont( 
    CFont* pFont, 
    BOOL bRedraw = TRUE ); 
    Parameters
    pFont 
    Specifies the new font. 
    bRedraw 
    If TRUE, redraw the CWnd object. 
    Requirements
      Windows CE versions: 1.0 and later
      Header file: Declared in Afxwin.h
      Platform: H/PC Pro, Palm-size PC, Pocket PC