   DrawItem and Icons
  Hello,I have some MFC specific question:I try to create an owner drawn button and do my drawing in the DrawItem function. Whereas I do not have a problem to blit my button states correctly with BitBlt I experience difficulties with DrawIconEx when I blit the icons. Sometimes they show up, sometimes not. When I have the situation that an icon is not drawn, i slowly pull in the button via the window from outside the screen inside and can see that it has been partially drawn.Why is that and how can I solve this problem ? And how is the call to DrawItem connected to the OnPaint function ? Thanks in advance.   
  I have no idea without seeing any code. You can check the return value of DrawIconEx to see if it really fails. If it does fail, check GetLastError.If it never fails there might be something with the painting order. DrawItem is AFAIK called from the interns of the button class during WM_PAINT. If you do one of both, you should never do the other.   