C语言如何实现一个正在循环运行的程序,当按下某个键时,运行另一个函数?? 10
1个回答
2018-06-02 · 知道合伙人互联网行家
关注
展开全部
Private stopIt As Boolean
Private Sub Command1_Click()
Dim shuzhi As Double
Dim shuzhi1 As Double
Text1.Text = "正在运行"
For shuzhi = 1 To 60000
If stopIt Then Exit Sub
DoEvents
For shuzhi1 = 1 To 20000
Next shuzhi1
Next shuzhi
Text1.Text = "完成"
End Sub
Private Sub Command2_Click()
Text1.Text = "中断运行"
stopIt = True
End Sub
Private Sub Command1_Click()
Dim shuzhi As Double
Dim shuzhi1 As Double
Text1.Text = "正在运行"
For shuzhi = 1 To 60000
If stopIt Then Exit Sub
DoEvents
For shuzhi1 = 1 To 20000
Next shuzhi1
Next shuzhi
Text1.Text = "完成"
End Sub
Private Sub Command2_Click()
Text1.Text = "中断运行"
stopIt = True
End Sub
追问
没看懂。。我希望就是我那个正在无限循环的函数,我按下1时,它就跳到另一个函数
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询