Solved

How to create an MFC Cbutton that displays text and icon or bitmap

Posted on 1997-11-05
1
1,629 Views
Last Modified: 2013-11-20
I am using VC 5.0 in an MFC SDI app and would like to be able to create push buttons in my dialogs that also draw an icon or bitmap along with its text.

Can you explain in detail how this is done, point me to where I can get all the details or best yet, have source or point me to source?

Thanks
0
Comment
Question by:rascal
1 Comment
 
LVL 7

Accepted Solution

by:
galkin earned 20 total points
ID: 1309478
CButton class functions SetBitmap() and SetIcon are what you need. you can find decription of these function in MFC CButton class help. If standard implementation doesn't answer to your requirements create owner draw button ovewrite OnDrawItem in parent class and perform custom painting
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
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…
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

18 Experts available now in Live!

Get 1:1 Help Now