var
  Form    : TForm;
  svGrid  : TDBGrid;

procedure FormClose(Sender :TObject; Action :TCloseAction);
begin
  Action := CaFree;
  if sender = Form then Form := nil;
end;

begin

 Form := TForm.create(application);
 Form.Width := 680;
 Form.Height:= 500;
 Form.Caption:= '??????';
 Form.Position := poScreenCenter;
 Form.OnClose := @FormClose;
 Form.FormStyle := fsMdiChild;

 svGrid := TDBGrid.create(form);
 svGrid.parent:=form;
 svGrid.Width := 670;
 svGrid.Height:= 450;


 while Form <> nil do Application.ProcessMessages;
end.
