Let's say I use a forms OnPaint event to draw a special form background.
When I now place a paintbox on this form, then the content of the paintbox is never visible if the form is skinned.
The problem seems to be that Form.OnPaint is called AFTER Paintbox.Paint.
(when you switch of skinning then the event order is correct again).
Here a tiny code snippet to verify that:
Code:
procedure TForm1.FormPaint(Sender: TObject);
begin
Canvas.Brush.Color:=clYellow;
Canvas.FillRect(Canvas.ClipRect);
OutputDebugString('Main Background');
end;
procedure TForm1.PaintBox1Paint(Sender: TObject);
begin
with PaintBox1.Canvas do
begin
moveto(0,0);
lineto(100,100);
end;
OutputDebugString('Main Paintbox');
end;
In the debug output you'll see first “Background” then “Paintbox” if the app is “normal”, and the other way round when the app is skinned. 🙁