这是工程文件的一段
var
LoginForm: TFrmLogin;
begin
Application.Initialize;
Application.CreateForm(TFrmMain, FrmMain);
LoginForm := TFrmLogin.Create(Application);
if LoginForm.ShowModal = 1 then
//means mrOK
begin
LoginForm.Free;
Application.Run
end
else
begin
LoginForm.Free;
FrmMain.Free;
end;
end.
来自:thx1180, 时间:2003-5-18 16:42:00, ID:1872061 | 编辑
program Test;
uses
Forms,
MainForm in 'MainForm.pas' {MainFrm},
Login in 'Login.pas' {LoginFrm};
{$R *.RES}
begin
Application.Initialize;
LoginFrm := TLoginFrm.Create(Application);
if LoginFrm.ShowModal = mrOK then
begin
LoginFrm.Free;
Application.CreateForm(TMainFrm, MainFrm);
Application.Run;
end
else
begin
LoginFrm.Free;
Application.Terminate;
end;
end.