When I try to draw on form , I've put that simple code on ButtonClick:
with Canvas do
begin
Pen.Color:=clGreen;
Canvas.Rectangle(20,20,100,60);
end;
it works nice, but if I put the GroupBox in the same coordinates(or interleaving coordinates) - GroupBox draws after my Rectangle. So, I put the same code in OnPaint method. Works well - I see my rectangle above GroupBox. But! If now I change the color of GroupBox to any, except clDefault - GroupBox again above my Rectangle.
I need Rectangle above all of components of form. How can I reach it?