【问题标题】:VC++ loop until button pressedVC++ 循环直到按下按钮
【发布时间】: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


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2014-09-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-12
      • 1970-01-01
      • 2017-07-03
      • 2021-11-12
      • 2021-05-17
      相关资源
      最近更新 更多