[Lazarus] How to close a window from code

Mattias Gaertner nc-gaertnma at netcologne.de
Wed Feb 1 18:37:49 CET 2012


On Wed, 01 Feb 2012 12:31:12 -0500
Timothy Groves <the.tail.kinker at gmail.com> wrote:

> On 12-02-01 12:14 PM, Mattias Gaertner wrote:
> > Do you mean a LCL form? Form1.Close;
> Well, I tried just Close from within a method of the form in question, 
> and that didn't work.  This did.  Any explanation as to why?  (Perhaps 
> the fact that close is also a Pascal reserved word?)

Did you get a compiler error?

This works too:

procedure TForm1.Button1Click(Sender: TObject);
begin
  Close;
end;



Mattias




More information about the Lazarus mailing list