I created a custom control whose class has CStatic
as base class. Currently I handle the drawing using WM_PAINT
event. But there is a strange behavior. When I re-enable the window after disabling it using CWnd::EnableWindow
function, it refuses to draw what I written in OnPaint
function. It draws the static control instead.
I agree that there is this standard method of overriding DrawItem
and using SS_OWNERDRAW
style. But what's wrong with WM_PAINT
?
void XXControl::OnPaint()
{
CPaintDC PaintDC( this );
// ** draw the control to PaintDC**
}
See Question&Answers more detail:os