先用shape画一个图形(圆啊,方啊都可以),命名shape1,另外放两个按钮Command1 Command2,再放个Timer,Timer的有一个In什么的属性改成100
极其简单,此代码未实际检验,应该没有问题,点击Pause暂停,再点Start继续。有问题找我
代码
Dim a as integer
Dim b as Boolean
Private Sub Form_Load()
Command1.caption="Pause"
Command2.caption="Start"
Timer1.enable=true
End Sub
Private Sub Command1_Click()
Timer1.enable=false
End sub
Private Sub Command2_Click()
Timer1.enable=true
End sub
Private Sub Timer1_Timer()
If a>3000 then b=true
If a<100 then b=false
If b=true then a=a-5
If b=false then a=a+5
Shape1.left=a
End Sub
Shape1.left=a