IDC_ABOUT设为OwnerDraw

CBitmapButton m_bmpAbout;
m_bmpAbout.LoadBitmaps(IDB_ABOUT1,IDB_ABOUT2);
VERIFY(m_bmpAbout.SubclassDlgItem(IDC_ABOUT,this));
m_bmpAbout.SizeToContent();

解决方案 »

  1.   

    CBitmapButton myButton; // Create the bitmap button (must include the BS_OWNERDRAW style). 
    myButton.Create(NULL, WS_CHILD|WS_VISIBLE|BS_OWNERDRAW, 
       CRect(10,10,100,100), pParentWnd, 1); // Load the bitmaps for this button. 
    myButton.LoadBitmaps(IDB_UP, IDB_DOWN, IDB_FOCUS, IDB_DISABLE); For more details about CBitmapButton, please visit 
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcemfc/htm/
    cbitmapb.aspFor your second question, you do not need to use the exact same size for 
    your button and your bitmap. The button will change the size to the same of 
    the bitmap. For more information on using CBitmapButton to resize a Bitmap to fit a 
    Button, please visit 
    http://support.microsoft.com/support/kb/articles/Q134/4/21.asp
      

  2.   

    pinel()我按照你的方法试了,可是一点反应都没有
      

  3.   

    笨笨,当然不能照抄了,你把button定义成全局的变量。