Solved

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

Posted on 1997-11-05
1
1,672 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASCII Non-Printable characters/codes and their HTML equivalents 6 132
only14 challenge 19 82
sumHeights  challenge 17 75
wordcount challenge 11 134
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.

821 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