Solved

Bitmap on a CButton

Posted on 1998-11-11
2
3,826 Views
Last Modified: 2013-11-20
I have a CButton that I want a bitmap on.

CBitmap m_bmpMyBitmap;
CButton m_btnMyButton;

m_bmpMyBitmap.LoadBitmap(IDB_BITMAP1);
m_btnMyButton.SetBitmap(m_bmpMyBitmap);

This works fine until I disable the button:

m_btnMyButton.EnableWindow(false);

The button now just has a gray square where the bitmap should be.
I want it to be a "disabled" looking picture.
The bitmap was drawn 16x16 and the background was light gray (same as a button).
If the background was filled white, disabled looks good but enabled shows white on the button.

What do I need to do?
0
Comment
Question by:joeslow
2 Comments
 

Accepted Solution

by:
ddeboskey earned 70 total points
Comment Utility
If you can use a CBitmapButton, you can create several bitmaps which correspond to the different states that the button can
take.

If you need to make a dialog button a CBitmapButton you can use the SubclassDlgItem function in CDialog.

0
 

Author Comment

by:joeslow
Comment Utility
I followed the example in the MFC help on CBitButton and was able to get a button on a dialog, but how do you control the exact size and placement of the button?
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Running shell command from Access 3 63
Get filename and folder into excel 7 67
Path of Workbook 3 44
Problem to open Excel file 15 35
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now