既然楼主知道了线程的方法,我想肯定大是想要这种了。 我这里 抛砖引玉 var Form1 : TForm1; Stop : Boolean; ... Procedure TForm1.Button1Click(Sender:TObject); begin Stop := False; While Not Stop do begin Application.ProcessMessage; //让程序处理其他消息 就行了。 end; end;Procedure TForm1.Button2Click(Sender:TObject); begin Stop := True; end;先点Button1,进入了死循环,这个时候点Button2,就退出循环了。
我这里 抛砖引玉
var
Form1 : TForm1;
Stop : Boolean;
...
Procedure TForm1.Button1Click(Sender:TObject);
begin
Stop := False;
While Not Stop do begin
Application.ProcessMessage; //让程序处理其他消息 就行了。
end;
end;Procedure TForm1.Button2Click(Sender:TObject);
begin
Stop := True;
end;先点Button1,进入了死循环,这个时候点Button2,就退出循环了。
例子在具体些好吗?