[Lazarus] Paintbox complete redraw
hdpc at talktalk.net
Wed Sep 24 00:14:56 CEST 2008
Benito van der Zander wrote:
> is there a way to change the whole paintbox in the OnPaint event?
> For example, if I draw this in Onpaint:
> and move another window in XP over the paintbox it is striped instead of
> being filled with a single color.
When the window covering PaintBox1 is removed, the operating system repaints only the newly exposed region, which your code fills
with a (new) randomly generated colour. Unless by chance that new colour happens to coincide with the previous Paintbox colour it
will look like exactly what you have coded for: a randomly coloured stripe.
If you replace
rgb(100, 100, 100)
you'll not notice the repainting because it will be painted in the same indistinguishable colour as before (well, there might be
More information about the Lazarus