Solved

Bitmap on a CButton

Posted on 1998-11-11
2
3,864 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
ID: 1324533
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
ID: 1324534
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.

791 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