【发布时间】:2012-03-18 17:12:04
【问题描述】:
在 button1_Click 上我调用方法 DoStuff();
DoStuff()
{
//how to make a loop within this method that pauses when I click button2 ?
SomeCodeToLoop();
}
【问题讨论】:
标签: events visual-c++ button loops
在 button1_Click 上我调用方法 DoStuff();
DoStuff()
{
//how to make a loop within this method that pauses when I click button2 ?
SomeCodeToLoop();
}
【问题讨论】:
标签: events visual-c++ button loops
将此 doStuff 代码移动到另一个线程中。当您按下按钮 2 时,要么暂停线程,要么使用一些 events 来通知线程等待事件发出信号。
【讨论】: