Hello, I've created a simple MFC Dialog Box in VC++ 2003 (VC++ Version 7). I need to add a bitmap to one of my buttons. It's a "Play" button, and i just need to add a simple bitmap to it. A little thing like adding a button should be easy, but i haven't had the fortune of finding out how. Could some one please explain how to do this, and if possible provide an example. Thank you! I'd really appreciate all input.
Add or put? Add implies having a bitmap along with a text. And the latter unfortunately is not that easy as it looks for the first glance. But if this is the put case, SetBitmap will do the trick alright.
I've seen it, but haven't found a good example.
Isn't that from MSDN good enough?
Code:
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 mark bitmap.
myButton.SetBitmap( ::LoadBitmap(NULL, MAKEINTRESOURCE(OBM_CHECK)) );
Bookmarks