0
On button1_Click我調用方法DoStuff();VC++循環直到按下按鈕
DoStuff()
{
//how to make a loop within this method that pauses when I click button2 ?
SomeCodeToLoop();
}
On button1_Click我調用方法DoStuff();VC++循環直到按下按鈕
DoStuff()
{
//how to make a loop within this method that pauses when I click button2 ?
SomeCodeToLoop();
}
將這個doStuff代碼移到另一個線程中。當你按下按鈕2時,暫停線程或使用一些events來發信號通知線程等待,直到事件發出信號。