> 实验证明:onclose被触发,OnDestroy没有触发
我用以下程序试了,一个也没触发。
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
var path:String;
inifile:Tinifile;
begin
path:=ExtractFilePath(paramstr(0));
inifile:=Tinifile.Create (path+'text.ini');
inifile.WriteString('FormClose','Close','触发了Close事件');
end;
procedure TForm1.FormDestroy(Sender: TObject);
var path:String;
inifile:Tinifile;
begin
path:=ExtractFilePath(paramstr(0));
inifile:=Tinifile.Create (path+'text.ini');
inifile.WriteString('FormDestroy','Destroy','触发了Destroy事件');
end;