在Activate过程中不能关闭窗口(50)

G

gdzscj

Unregistered / Unconfirmed
GUEST, unregistred user!
正在开发一个程序,在这个程序运行时很判断一个参数,如果正确就继续运行,如果不正确就退出。在主窗口的activate过程中这样写的:procedure Tlogin.FormActivate(Sender: TObject);var myinifile:tinifile; syspath:string; sn:string;begin syspath:=GetCurrentDir(); myinifile:=Tinifile.Create(syspath+'/option.dat'); sn:=sncreate(); if sn<>myinifile.ReadString('regid','sn','') then begin application.MessageBox('注册码不正确,请重新运行程序!','系统提示'); passed:=false; close; end;end;但运行起来发现close不起作用。这么为什么呢,请各位指教!
 
Z

zbdzjx

Unregistered / Unconfirmed
GUEST, unregistred user!
用Application.Terminate
 
G

gdzscj

Unregistered / Unconfirmed
GUEST, unregistred user!
接受答案了.
 

Similar threads

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