Board index » delphi » TPaintBox.Paint does not paint all...

TPaintBox.Paint does not paint all...

Hi,

I have a TPaintBox in Delphi 3.
Its contents should change after a modal window
closes.

However only the part which was covered by
the modal window gets repainted and the rest
stays the old contents.

What do I have to do in the TPaintBox.OnPaint event
so that it really does draw on the whole canvas ?

Greetings
Ralph Muench

 

Re:TPaintBox.Paint does not paint all...


Quote
Leon Fuks <leon.f...@psi.ch> wrote:
>However only the part which was covered by
>the modal window gets repainted and the rest
>stays the old contents.

>What do I have to do in the TPaintBox.OnPaint event
>so that it really does draw on the whole canvas ?

Nothing special.  However, when the modal window is closed, you need
to call the paintbox's Invalidate method.  Normally, Windows will only
repaint the region of the control which needs to be repainted - in
this case, the area that was covered by the modal form.  Invalidating
the control forces Windows to repaint the whole thing.

Re:TPaintBox.Paint does not paint all...


On Tue, 24 Jun 1997 10:51:44 +0200, Leon Fuks <leon.f...@psi.ch>
wrote:

Quote

>I have a TPaintBox in Delphi 3.
>Its contents should change after a modal window
>closes.

If the contents of a control change you should call it's Invalidate()

Quote
>However only the part which was covered by
>the modal window gets repainted and the rest
>stays the old contents.

Quite right, the Paint mechanism tries to restore the OLD contents
with a minimum of effort (flicker).

-hh-

Other Threads