界面上有3个按钮:begin、stop、pause单击begin:开始计算单击stop:计算终止单击pause:计算暂停delphi中如何实现谢谢 

解决方案 »

  1.   

      while () do
      begin
       (数据计算……)    if pause then
        begin
            while pause do
            begin
              Application.ProcessMessages;
            end;
        end;
      end;这个可以吗?
      

  2.   

    主线程创建一个枚举变量,状态就3个。
    eStart,ePause,eStop在工作线程,每个循环都判断一下这个枚举变量的状态,根据状态,这个线程作出响应的反应。
    while True do
        begin
        if 枚举变量=开始 then
        else if 枚举变量=暂停 then
        else if 枚举变量=停止 then
        .....
            
        end;