两个static我想让一个的字体比零一个大许多,怎么实现呀?多谢大家?

解决方案 »

  1.   

    如果是用MFC CStaic::SetFont否则::SelectObject(statichdc, staticfont);
      

  2.   

    对不同的static设置不同的字体,设置字体如下
    由于控件是也是窗口,用户可以调用CWnd: : SetFont指定新字体。该函数用一个Cfont指针,要保证在控件撤消之前不能撤消字体对象。下例将下压按钮的字体改为8点Arial字体: 
    //Declare font object in class declaration (.H file ). 
    private : Cfont m_font 
    // Set font in class implementation (.Cpp file ). Note m_wndButton is a 
    //member variable added by ClassWizard.DDX routines hook the member 
    //variable to a dialog button contrlo. 
    BOOL CSampleDialog : : OnInitDialog ( ) 

    … 
    //Create an 8-point Arial font 
    m_font . CreateFont (MulDiv (8 , -pDC 
    —> GetDeviceCaps(LOGPIXELSY) ,72). 0 , 0 , 0 , FW_NORMAL , 0 , 0,0, ANSI_CHARSER, OUT_STROKE_PRECIS , 
     
    CLIP_STROKE _PRECIS , DRAFT _QUALITY 
    VARIABLE_PITCH |FF_SWISS, _T("Arial") ) 
     
    //Set font for push button . 
    m_wndButton . SetFont (&m _font ) 
     
    …