在项目文件中可以写: Application.CreateForm(TfrmMain, frmMain); Application.Initialize; with TfrmLogin.Create(Application) do begin ShowModal; if (UserName = ...) and (PassWord = ...) then begin Close ; Application.Run ; end else Application.Terminate ; end;
也可以在MDIForm中放个Timer控件。建立MDIForm时,设置Timer.Enabled:=True在Timer事件中:Timer.Enabled:=False;with TfrmLogin.Create(Application) do begin ShowModal; if (UserName = ...) and (PassWord = ...) then begin Close ; Application.Run ; end else Application.Terminate ; end;
以上两种方法都是在主框架显示之"后"弹出系统登陆的对话框的, 我想知道怎样在主框架显示之"前"弹出系统登陆的对话框 -------------------------------------------------------------楼主武断了吧 :) 在项目文件中可以写: Application.CreateForm(TfrmMain, frmMain); Application.Initialize; with TfrmLogin.Create(Application) do begin ShowModal; if (UserName = ...) and (PassWord = ...) then begin Close ; Application.Run ; end else Application.Terminate ; end;真是在主框架显示之"后"弹出系统登陆的对话框的 ?
Application.Initialize;
with TfrmLogin.Create(Application) do
begin
ShowModal;
if (UserName = ...) and (PassWord = ...) then
begin
Close ;
Application.Run ;
end
else
Application.Terminate ;
end;
begin
ShowModal;
if (UserName = ...) and (PassWord = ...) then
begin
Close ;
Application.Run ;
end
else
Application.Terminate ;
end;
我想知道怎样在主框架显示之"前"弹出系统登陆的对话框
-------------------------------------------------------------楼主武断了吧 :) 在项目文件中可以写: Application.CreateForm(TfrmMain, frmMain);
Application.Initialize;
with TfrmLogin.Create(Application) do
begin
ShowModal;
if (UserName = ...) and (PassWord = ...) then
begin
Close ;
Application.Run ;
end
else
Application.Terminate ;
end;真是在主框架显示之"后"弹出系统登陆的对话框的 ?