如何运行登录窗口? ( 积分: 100 )

  • 主题发起人 shandong1
  • 开始时间
S

shandong1

Unregistered / Unconfirmed
GUEST, unregistred user!
在 main 主窗口的 FormCreate 中运行
if username='' then
begin
login.ShowModal;
为什么是错误的?
找了一个别人的,在 main 主窗口的 FormCreate 中运行
if not LOginExecute(Tlogin) then
Application.Terminate;
也是出错:[错误] Undeclared identifier:'LoginExecute'
错在哪儿?
怎么运行登录窗口?
 
C

ChrisMao

Unregistered / Unconfirmed
GUEST, unregistred user!
是因为你在引用登录窗体时它并没有被创建。
if username='' then
begin
with TLogin.Create(Application)do
try
ShowModal;
finally
Free;
end;

end;
 
Q

qrsgroup

Unregistered / Unconfirmed
GUEST, unregistred user!
1. 在main显示的时候
frmLogin.create(application);
frmlogin.showmodal;
2. 在主程序运行前创建 frmLogin,此时最先显示frmLogin
如:
Application.Initialize;
frmLogin.Create(application);
frmlogin.showmodal;
Application.CreateForm(TMain, Main);
Application.Run;
 
S

shandong1

Unregistered / Unconfirmed
GUEST, unregistred user!
行了,是这样,谢谢 ChrisMao 老师
 
S

shandong1

Unregistered / Unconfirmed
GUEST, unregistred user!
分完分刷新后才看到qrsgroup老师的回复,对不起了
 

Similar threads

S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
854
DelphiTeacher的专栏
D
I
回复
0
查看
688
import
I
顶部