Board index » delphi » How to avoid repaint a control immediateley

How to avoid repaint a control immediateley

Hi

I have a form on which I perform 3 successive operations which trigger a
wm_paint message :
- SetWindowRgn
- Canvas.draw
- SetBounds.

I want the repaint event to take place only at the end of the third
operation.

How do I  do this ? Is it possible to use BeginPaint - EndPaint in this
situation ?

Thank you for any suggestion.

Rgis PIEL

 

Re:How to avoid repaint a control immediateley


what this does is turn of repaint until you activate it again (sendmessage)
invalidaterect repaints the control again...

Try it and let me know...

Jose Sanchez

"Rgis Piel" <regis.p...@wanadoo.fr> escribi en el mensaje
news:3e032a57$1@newsgroups.borland.com...

Quote
> Hi

> I have a form on which I perform 3 successive operations which trigger a
> wm_paint message :
> - SetWindowRgn
> - Canvas.draw
> - SetBounds.

> I want the repaint event to take place only at the end of the third
> operation.

> How do I  do this ? Is it possible to use BeginPaint - EndPaint in this
> situation ?

> Thank you for any suggestion.

> Rgis PIEL

Re:How to avoid repaint a control immediateley


Hi Jose

"Jose J. Sanchez" <SanchezJ...@hotmail.com> a crit dans le message de news:
3e033...@newsgroups.borland.com...

Quote
>   SendMessage(YourControl.Handle, WM_SETREDRAW, Integer(False), 0);
>   // do your procesing here
>   SendMessage(YourControl.Handle, WM_SETREDRAW, Integer(True), 0);
>   InvalidateRect(YourControl.Handle, nil, True);

> what this does is turn of repaint until you activate it again
(sendmessage)
> invalidaterect repaints the control again...

> Try it and let me know...

> Jose Sanchez

Thanks for your answer.
I tried it. Infortunately it does not work in this situation :
I think the problem comes from the SetWindowRgn function. Only the region is
repainted (and not the bitmap on the canvas) and the old region is not
erased.
May be because I use it inside a timer ?

Thanks

Rgis

Other Threads