Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Erase background of Dialog Control ??????

76 views
Skip to first unread message

RSM

unread,
Dec 12, 1999, 3:00:00 AM12/12/99
to
I have a subclassed CStatic control in a dialog and I would like to
invalidate just the control and have it erase its prior paint of itself,
and then repaint itself - all on demand on demand (by function call).

Suggestions of Invalidate() and Update() on the control itself were a
great step in the right direction. The control (subclassed CStatic)
did repaint itself with the new design and the annoying flicker of the
all controls repainting themselves on the Invalidate() 'ation of the
entire dialog was gone, but ..... the individual control failed to
erase its background first (left the old design and just printed the new
pattern (using MoveTo() and LineTo()) over the top of the old.
Changing (control).Invalidate() to (control).Invalidate(TRUE) did not
appear to make any difference. Is there a way to force a control
(CStatic) to do a background erase before OnPainting itself ? Or
maybe it did earse the background but did so with a transparent brush
?).

Any suggestions would be much appreciated.


Still trying ....
7560...@compuserve.com

bdama...@gmail.com

unread,
Jul 3, 2012, 5:39:27 AM7/3/12
to
Had the same problem and the only way I could make it work is to call :
SetWindowText(L"");
It seems to clear the window without calling OnPaint.
You can restore the window text later using:
SetRedraw(FALSE);
SetWindowText(oldValue);
SetRedraw(TRUE);
0 new messages