-
October 14th, 2010, 04:17 PM
#1
Adding Bitmap To button?
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.
-
October 14th, 2010, 04:23 PM
#2
Re: Adding Bitmap To button?
Did you try to use CButton::SetBitmap method?
Victor Nijegorodov
-
October 15th, 2010, 10:14 AM
#3
Re: Adding Bitmap To button?
Originally Posted by VictorN
Did you try to use CButton::SetBitmap method?
Would you please be able to elaborate? I've seen it, but haven't found a good example.
-
October 15th, 2010, 10:53 AM
#4
Re: Adding Bitmap To button?
i just need to add a simple bitmap to it
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)) );
Best regards,
Igor
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|