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

How to clear a PaintBox?

1,130 views
Skip to first unread message

Simon Hürlimann

unread,
Dec 3, 1998, 3:00:00 AM12/3/98
to
Hi,
does anybody know if there is a procedure to clear a TPaintBox? The only
way I know is to paint a filled rectangle on the canvas. But I thinks
there must be a more comfortable way.

Thanks,
Simon


Ralph Friedman (TeamB)

unread,
Dec 3, 1998, 3:00:00 AM12/3/98
to
Simon:

Use code similar to:

procedure TForm1.CBoxClick(Sender: TObject);
begin
PaintBox1.Invalidate;
end;

procedure TForm1.PaintBox1Paint(Sender: TObject);
begin
with PaintBox1.Canvas do
begin
if CBox.Checked then
Brush.Style := bsClear
else
begin
Brush.Color := clFuchsia;
Brush.Style := bsSolid;
end;

FillRect(ClientRect);
end;
end;

--
Regards
Ralph (TeamB)
(No private e-mail replies, please, unless explicitly requested).
--
Simon Hürlimann wrote in message <3666B3AA...@hotmail.com>...

0 new messages