VB 关于记时器的问题 大家看看哪里有问题

来源:百度知道 编辑:UC知道 时间:2024/05/04 22:16:11
我现在在做一个东西 是这样的 先是里面有1个IMAGE 按一下之后 出现一个PICTUREBOX 这个PICTUREBOX里有4个LABEL,2个TIMER..

2个LABEL是显示记时的..2个LABEL是控制的 一个LABEL是暂停 按了之后会边成恢复 另一个是停止(用来清0的) 最开始的那个IMAGE是让两个TIMER开始的

代码如下:

Dim a As Integer, c As Integer, flag As Boolean

Private Sub Form_Load()
With Picture12
.Visible = False
End With

Private Sub Image1_Click()
flag = True
Timer2.Interval = 10
Timer3.Interval = 20000
Picture12.Visible = True

Private Sub Timer2_Timer()
Timer3.Enabled = True
a = a + 1
With Label25
.Caption = a
If a < 128254 Then Exit Sub
If a = 128254 Then
a = 0
End If
End With
End Sub

Private Sub Timer3_Timer()
c = c + 1
With Label26
.Caption = c & "%"

If c < 100 Then Exit Sub
If c = 100 Then
c = 0
End If
End With
End Sub

Private Sub Label37_Click()
If flag = False Then
Tim

Private Sub Image1_Click()
flag = True
Timer2.Interval = 10
Timer3.Interval = 20000
Picture12.Visible = True
Timer2.Enabled = True '增加部分
Timer3.Enabled = True '增加部分
End Sub

Private Sub Image1_Click()
flag = True
Timer2.Interval = 10
Timer3.Interval = 20000
Picture12.Visible = True

怎么都没有end sub 你咋运行起来的? 在代码最上面加上这句话
Option Explicit
然后按ctrl+f5 你看你能运行起来吗?

暂停的时候应该保存变量。