Solved

Bitmap on a CButton

Posted on 1998-11-11
2
3,840 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
cat dog challenge 18 124
xyBalance chalenge 58 88
dog bark java program 15 87
either24  challenge 19 90
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 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

24 Experts available now in Live!

Get 1:1 Help Now