void CStaticEx::setFont( LONG fontHeight      /* = -8                         */, 
                         LONG fontWeight      /* = FW_NORMAL                  */,
                         UCHAR pitchAndFamily /* = DEFAULT_PITCH | FF_DONTCARE*/,
                         LPCSTR faceName      /* = _T("MS Sans Serif")        */ )
{
    if ( m_pCFont ) 
    {
        delete m_pCFont;
    }
    m_pCFont = new CFont;    const CLogFont lf( fontHeight, 
                       fontWeight,
                       pitchAndFamily,
                       faceName
                     );    m_pCFont->CreateFontIndirect( &lf );    SetFont( m_pCFont );
}

解决方案 »

  1.   

    m_ctrlShowMessage是一个CEdit
    CFont m_font;
    CFont* pFont = m_ctrlShowMessage.GetFont();
    LOGFONT lf;
    pFont->GetLogFont(&lf);
    lf.lfWeight = 50;
    lf.lfHeight = 30;
    m_font.CreateFontIndirect(&lf);
    m_ctrlShowMessage.SetFont(&m_font);
      

  2.   

    to strip,GJA106:
    一般的控件是没问题,
    我是在工具栏里使用了一个组合框,
    但组合框里字大,我也是用SetFont,但编译后程序不能运行,
    而且组合框没有竖直滚动条(用了CBS_AUTOHSCROLL风格)