Click here to Skip to main content
15,919,434 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to draw a bitmap on top of button? Pin
Naveen21-Feb-07 1:44
Naveen21-Feb-07 1:44 
GeneralRe: How to draw a bitmap on top of button? Pin
Igor Jerosimic21-Feb-07 2:03
Igor Jerosimic21-Feb-07 2:03 
GeneralRe: How to draw a bitmap on top of button? Pin
Naveen21-Feb-07 2:09
Naveen21-Feb-07 2:09 
GeneralRe: How to draw a bitmap on top of button? Pin
prasad_som21-Feb-07 2:15
prasad_som21-Feb-07 2:15 
GeneralRe: How to draw a bitmap on top of button? Pin
Naveen21-Feb-07 2:18
Naveen21-Feb-07 2:18 
AnswerRe: How to draw a bitmap on top of button? Pin
prasad_som21-Feb-07 3:02
prasad_som21-Feb-07 3:02 
GeneralRe: How to draw a bitmap on top of button? Pin
Naveen21-Feb-07 16:13
Naveen21-Feb-07 16:13 
AnswerRe: How to draw a bitmap on top of button? Pin
prasad_som21-Feb-07 18:37
prasad_som21-Feb-07 18:37 
Naveen R wrote:
Whats do you mean. If I didnt called the default procedure for WM_PAINT, then how will the button get painted?


You are confusing between painting a control and drawing a control.

In case of of non-owner drawn control windows takes care of drawing/creating control. WM_PAINT message is meant to paint invalidated area.

Now about calling base class OnPaint. It simply does default painting routines and validates invalidated area.

So Consider this function,
void CMyButton::OnPaint()
{
  CButton::OnPaint();//
  //Here at above line invlaidated client area will be validated 
and code following has no effect
 CPaintDC dc(this); // device context for painting
  //drawing routine follows
}

Consider another scenario,
void CMyButton::OnPaint()
{
CPaintDC dc(this); // device context for painting
//drawing routine follows
 //till this point due to call to <code>CPaintDC</code> c'tor 
invalidated area will be validated and 
CButton::OnPaint has no effect.
CButton::OnPaint();//

}


Hope this clears your doubts.




GeneralRe: How to draw a bitmap on top of button? Pin
Naveen21-Feb-07 19:52
Naveen21-Feb-07 19:52 
GeneralRe: How to draw a bitmap on top of button? Pin
Igor Jerosimic21-Feb-07 23:37
Igor Jerosimic21-Feb-07 23:37 
GeneralRe: How to draw a bitmap on top of button? Pin
Naveen21-Feb-07 23:53
Naveen21-Feb-07 23:53 
GeneralRe: How to draw a bitmap on top of button? Pin
Igor Jerosimic22-Feb-07 0:03
Igor Jerosimic22-Feb-07 0:03 
GeneralRe: How to draw a bitmap on top of button? Pin
Igor Jerosimic26-Feb-07 0:24
Igor Jerosimic26-Feb-07 0:24 
GeneralRe: How to draw a bitmap on top of button? Pin
Naveen26-Feb-07 2:08
Naveen26-Feb-07 2:08 
GeneralRe: How to draw a bitmap on top of button? Pin
Igor Jerosimic26-Feb-07 2:16
Igor Jerosimic26-Feb-07 2:16 
GeneralRe: How to draw a bitmap on top of button? Pin
Naveen26-Feb-07 2:24
Naveen26-Feb-07 2:24 
GeneralRe: How to draw a bitmap on top of button? Pin
Igor Jerosimic26-Feb-07 2:27
Igor Jerosimic26-Feb-07 2:27 
GeneralRe: How to draw a bitmap on top of button? Pin
Igor Jerosimic28-Feb-07 1:41
Igor Jerosimic28-Feb-07 1:41 
GeneralRe: How to draw a bitmap on top of button? Pin
Naveen28-Feb-07 1:50
Naveen28-Feb-07 1:50 
AnswerRe: How to draw a bitmap on top of button? Pin
prasad_som22-Feb-07 2:37
prasad_som22-Feb-07 2:37 
AnswerRe: How to draw a bitmap on top of button? Pin
prasad_som21-Feb-07 1:53
prasad_som21-Feb-07 1:53 
QuestionRe: How to draw a bitmap on top of button? Pin
David Crow21-Feb-07 3:23
David Crow21-Feb-07 3:23 
AnswerRe: How to draw a bitmap on top of button? Pin
Hamid_RT21-Feb-07 5:27
Hamid_RT21-Feb-07 5:27 
GeneralRe: How to draw a bitmap on top of button? Pin
ThatsAlok21-Feb-07 6:24
ThatsAlok21-Feb-07 6:24 
AnswerRe: How to draw a bitmap on top of button? Pin
Igor Jerosimic21-Feb-07 23:42
Igor Jerosimic21-Feb-07 23:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.