delphi 登录界面点击关闭或者直接叉掉该页面还是会到主界面

2024-11-16 16:41:30
推荐回答(1个)
回答1:

直接在工程文件(?.bpr),菜单project-->View Source
program Project2;

uses
Forms,
Controls,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {Form2};

{$R *.RES}
begin
Application.Initialize;
Application.CreateForm(TForm2, Form2);
with TForm1.Create(Application) do
begin
if ShowModal <> mrOk then
begin
Exit;
end;
end;
Application.ShowMainForm := True;
Application.Run;
end.