----- Original Message -----
From: "vss" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Wednesday, October 09, 2002 10:43 AM


> yeah, that went thru my mind, but it seemed a bit of a manky way of
> doing it....ok well I will try it non the less.

TWindowControl descendants have their own windows canvas, but paint boxes
and other TGraphicControl descendants share the windows canvas of their
parent.  So anything you put into a TPaintBox (for example) will overwrite
anything that you previously drew in another overlapping TPaintBox.

The solution is to redraw the background to erase the existing text.  If
it's just a static color then fillrect is the solution, otherwise you'll
have to redraw the background image that occupies the same rect as the text.

Of course if the background is just a static color then the simplest thing
to do is use a brush style of bsSolid with the appropriate brush color and
use TCanvas.TextRect to write the text out.  That will clear the rect and
draw the text in one operation, which reduces flickering.

It may not be elegant, but it's the way it is.

--
Corey Murtagh
The Electric Monk
"Quidquid latine dictum sit, altum viditur."

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to