Click here to Skip to main content
12,699,883 members (36,131 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++ MFC
i want to show a bitmap on button , searched google but not getting how to implement it sp any bidy can give me suggestion about this
Posted 18-Jul-12 3:10am
Wes Aday 18-Jul-12 9:25am
"searched google but not getting how to implement it"... you must not be trying very hard. What exactly are you having trouble with? Have you actually tried anything at all?
Joan Murt 19-Jul-12 3:11am
My vote of 1 is due to the lack of explanation, the lack of trying and the lack of interest even with a good answer like the one from Chris Losinger.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

look here:[^]

there are dozens of bitmap button articles.
yasardiwan 18-Jul-12 8:44am
didnt understand my friend
Wes Aday 18-Jul-12 9:24am
What did you not understand?
Joan Murt 19-Jul-12 3:10am
Be water my friend... :D

I was about to post the same link, there are plenty of articles there which are related to what you need, with samples, projects... take a look at it and you will see it.
Joan Murt 19-Jul-12 3:11am
The best link available to give the best answer possible. my 5.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

Owner draw will enable you to handle only drawing of the button, it will not effect click, double click etc event of the button.

To make button owner draw you have to specify BS_OWNERDRAW style when you create the button.

by specifying BS_OWNERDRAW style,you enable The owner window receives a WM_DRAWITEM message when a visual aspect of the button has changed.

You can handle this message by overriding(for that you have to create a class which is derived from CButton class)
DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) 
lpDrawItemStruct variable have information which state the button gaining. e.g
if (lpDrawItemStruct->itemState & ODS_SELECTED){ // draw selected state of button as your wish.}
similarly different style for different control. for that study this link[^]

similarly you can draw other states of the button.
here[^] they give a example.
I hope this is helpful.

Sorry for my english.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Here is another article that can help[^]

All the Best!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 20 Jul 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100