paintbox is on panel, both alClient.
procedure TForm1.PaintBox1Paint(Sender: TObject);
begin
Form1.Caption := IntToStr(PaintBox1.Canvas.Width) + ',' + IntToStr(PaintBox1.Canvas.height);
PaintBox1.Canvas.Line(0, 0, PaintBox1.Canvas.Width-1, PaintBox1.Canvas.Height-1);
end;
procedure TForm1.PaintBox1Resize(Sender: TObject);
begin
PaintBox1.Invalidate;
end;
When form stretched out, numbers are printed, when shrank, nothing happens about numbers at form caption.
Thought "PaintBox1.Canvas.Line" works all the time as expected.
Do tell how this works ?