如何在CButton中显示位图!!

1.对应的CButton的BitmMap要设置为TRUE
BOOL CMyButtonDlg::OnInitDialog()
 
 CButton* cbpTest = NULL;
 HINSTANCE hInstance=AfxGetResourceHandle();
 m_hBmp4=(HBITMAP)LoadImage(hInstance, MAKEINTRESOURCE(IDB_BITMAP1), IMAGE_BITMAP, 0, 0, 0);
 cbpTest = (CButton*)GetDlgItem(IDC_BUTTON4);
 ::PostMessage(cbpTest->GetSafeHwnd(), BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)m_hBmp4);

你可能感兴趣的:(职场,休闲,CButton中显示位图)