应用思考-教育技术论坛

标题: VBA中如何停止一个无终止条件的循环 [打印本页]

作者: etthink    时间: 2019-10-29 23:07
标题: VBA中如何停止一个无终止条件的循环
比如用循环生成一个为断变化的随机数,如何通过按钮停止随机数的变化呢?


作者: etthink    时间: 2019-10-29 23:16
begin
  memo1:=tmemo.Create(self);
if  button1.Caption='start' then
    button1.Caption :='stop'
Else if    button1.Caption ='stop' then
    button1.Caption :='start'
else
     button1.Caption :='stop';
Randomize ;
memo1.Text :=inttostr(random(20));
  Showmessage(memo1.Text );

end;
作者: etthink    时间: 2019-11-3 20:28
暂停1s
Application.Wait (Now + TimeValue("00:00:01"))
作者: etthink    时间: 2021-12-6 20:34
sleep




欢迎光临 应用思考-教育技术论坛 (http://www.etthink.com/) Powered by Discuz! X3.4