怎样在一个按钮控件上加位图?我用的是CButton类。

解决方案 »

  1.   

    m_button1.SubclassDlgItem(IDC_OK,this);
    m_button1.SetIcon(IDI_OK1,IDI_OK2);
    m_button1.SetActiveBgColor(RGB(220,220,220));即可
      

  2.   

    CButton::SetBitmapexample:CButton myButton;// Create a bitmap button.
    myButton.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_BITMAP, 
       CRect(10,10,60,50), pParentWnd, 1);// Set the bitmap of the button to be the system check  bitmap.
    myButton.SetBitmap( ::LoadBitmap(NULL, MAKEINTRESOURCE(OBM_CHECK)) );
      

  3.   

    我试了还是不可以,我自己有一幅bmp位图想调入,应该怎么实现?
      

  4.   

    HICON hIcon;
    hIcon=AfxGetApp()->LoadIcon (IDI_SEL_ICON);
    m_wndIconButton.SetButtonStyle(WS_CHILD|WS_VISIBLE|BS_ICON);
    m_wndIconButton.SetIcon (hIcon);
    将按钮设成:Icon、Owner draw
      

  5.   

    如加载位图,用loadBitmap(ID);
    将按钮设成:Bitmap、Owner draw
      

  6.   

    http://www.softechsoftware.it/
    我试过了,很好用的