Ich würde einen OnPaint Handler erstellen für die Paint Boxes, aber nicht das OnPaint Ereignis des Forms. Kurzes Beispiel
Code:
procedure BoxesOnPaint(Sender: TPaintBox);
var
PB: TPaintBox;
Bmp: TBitmap;
begin
if Sender = PaintBox1 then begin
PB := PaintBox1;
Bmp := Bitmap1;
end else if Sender = PaintBox2 then begin
PB := PaintBox2;
Bmp := Bitmap2;
end else if Sender = PaintBox3 then begin
PB := PaintBox3;
Bmp := Bitmap3;
end else if Sender = PaintBox4 then begin
PB := PaintBox4;
Bmp := Bitmap4;
end else begin
...
Exit;
end;
...
PB.Canvas.CopyRect(R, Bmp.Canvas, R); // R = TRect