unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ExtCtrls,
  {}
  UTestForm;

type
  TMainForm = class(TForm)
    Panel1: TPanel;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    procedure BitBtn2Click(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);

  private

  public
    procedure Start();
  end;

var
  MainForm: TMainForm;

implementation
{$R *.dfm}
{------------------------------------------------------------------------------}
procedure TMainForm.BitBtn1Click(Sender: TObject);
begin
	Close();
end;

procedure TMainForm.BitBtn2Click(Sender: TObject);
begin
	Start();
end;

procedure TMainForm.Start();
begin
	try
		TestForm := TTestForm.Create(Self);
		TestForm.ShowModal();
   finally
   	FreeAndNil(TestForm);
   end;
end;

end.

