2012-03-18 113 views
0

On button1_Click我调用方法DoStuff();VC++循环直到按下按钮

DoStuff() 
{ 
    //how to make a loop within this method that pauses when I click button2 ? 
    SomeCodeToLoop(); 
} 

回答

1

将这个doStuff代码移到另一个线程中。当你按下按钮2时,暂停线程或使用一些events来发信号通知线程等待,直到事件发出信号。