或者用什么其他设施也一样: const FormClosing = -1; procedure TForm1.Button1Click(Sender: TObject); var Task: ITask; begin Task := TTask.Create( procedure() begin while True do begin if Self.Tag = FormClosing then Break; Edit1.Text := DateTimeToStr(Now); end; end); Task.Start; end; procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); begin Self.Tag := FormClosing; end;