如何接受消息,中断正在处理的过程
2006-02-04 13:54:21 来源:WEB开发网核心提示: var Interrupt:boolean;PRocedure TForm1.Button5Click(Sender: TObject);begin memo1.Lines.Add('Button5Click OK'); Interrupt:=true;end;procedure TForm1.B
var Interrupt:boolean;
PRocedure TForm1.Button5Click(Sender: TObject);
begin
memo1.Lines.Add('Button5Click OK');
Interrupt:=true;
end;
procedure TForm1.Button6Click(Sender: TObject);
var i,j,n:integer;
begin
Interrupt:=false;
for i:=0 to 10000 do
for j:=0 to 10000 do
begin
inc(n);
application.ProcessMessages;
if Interrupt then
begin
memo1.Lines.Add('Interrupt OK');
exit;
end;
end;
memo1.Lines.Add('Button6Click OK');
end;
更多精彩
赞助商链接