unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm2 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    procedure Button2Click(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private

  public

  end;

var
  Form2: TForm2;

implementation
{$R *.dfm}
{------------------------------------------------------------------------------}
procedure TForm2.Button2Click(Sender: TObject);
begin
   ModalResult := mrNone;
end;

procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
	Action := caFree;	// (1)
end;

procedure TForm2.FormDestroy(Sender: TObject);
begin
	Form2 := Nil;	// (2)
end;

end.
