I'll suppose from here that we will be working on the Ok button (Id= IDOK) of a dialogbox CTestDlg class. This is the same for all the others
to add a bitmap to a button, follow the following procedure:
- add three bitmaps in the resource of your app and called them OKU ( for Up), OKD ( for Down) and OKF ( for focus)
You draw them yourself or you try to steal from an other application ....)
- add these lines in the include file of CTestDlg class:
protected:
CBitmapButton m_OkButton;
- add these in the constructor of the CTestDlg class:
// Load Bitmaps to Display Owner-Drawn Buttons
if ( !m_OkButton.LoadBitmaps( MAKEINTRESOURCE( OKU),
MAKEINTRESOURCE( OKD), MAKEINTRESOURCE( OKF)))
{
AfxMessageBox( "Unable to get Bitmpas"
AfxThrowResourceException();
}
- add these in the OnInitDialog function of the CTestDlg class:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.