[Lazarus] TForm.OnCreate and Application.MainForm.Caption

John Landmesser johnml at online.de
Mon Nov 14 10:51:00 CET 2011


Error on Lazarus Windows(!):
"Lazarus 0.9.31 r33456 FPC 2.5.1 i386-win32-win32/win64"

procedure TForm1.FormCreate(Sender: TObject);
begin
  // next line produces error
  Application.MainForm.Caption:= Application.Title;
  // next line does NOT produce an error
  Form1.Caption:= Application.Title;
end;

//BUT(!!),you get no error with the OnShow event 

procedure TForm1.FormOnShow(Sender: TObject);
begin
  // next line does NOT produces  error
  Application.MainForm.Caption:= Application.Title;
end;


What is the reason for that ?

-- 
John




More information about the Lazarus mailing list