退出按钮写 
close;
application.Terminate;
view source: Application.Initialize;
  Application.CreateForm(TForm_main, Form_main);
  Application.CreateForm(Tdm1, dm1);
  Application.CreateForm(TForm_denlu, Form_denlu);
  form_denlu.showmodal;
  if (okno= true) then begin     //okno 是从确定按钮 中取的
  Application.Run;以前没有问题的,但是这次程序总是在登录退出时报错.请帮我看看.

解决方案 »

  1.   

    if (okno= true) then begin     //okno 是从确定按钮 中取的 这行好像是多余的
      

  2.   

    不是多余的,要判断密码是否正确.以前用单用close就行了,现在总是报 Runtime error 216 at ******* 真是讨厌呀
      

  3.   

    if (okno= true) then begin     //okno 是从确定按钮 中取的 这行确实是多余的...在你的登录窗口中,若登录失败,直接在登录窗口中Application.Terminate;
      

  4.   

    同意楼上的,IF (okno =true) then begin 
    是有点多佘,登录窗体自己进行判断,如果用户名密码错误则Application.Terminate 
    登录窗体先隐藏,先不要关闭。
    form_denlu.hide ;
      

  5.   

    退出的时候直接terminate就可以了
    不必close
      

  6.   

    这样就很好了。  Application.Initialize;
      Application.CreateForm(TForm_denlu, Form_denlu);  form_denlu.showmodal;
      if (form_denlu.ModalResult <> true) then exit;  Application.CreateForm(TForm_main, Form_main);
      Application.CreateForm(Tdm1, dm1);
      Application.Run;