在线等。关于计算机二级VB,谁帮我看下代码

来源:百度知道 编辑:UC知道 时间:2024/06/11 12:36:23
Dim x As Integer
Private Sub Command1_Click()
x = x + 1
If x Mod 2 = 1 Then
Timer1.Enabled = True
Command1.Caption = "暂停"
Else
Timer1.Enabled = False
Command1.Caption = "演示"
Timer1.Interval = 100
Label1.Left = -Label1.Width
End If
End Sub

Private Sub Command2_Click()
End
End Sub

Private Sub Timer1_Timer()
Label1.Left = Label1.Left + 150
If Label1.Left >= Me.Width Then
Label1.Left = -Label1.Width
End If
End Sub
为什么运行后label不能立刻移动,第三次才移动呢?

Dim x As Integer
Private Sub Command1_Click()
x = x + 1
If x Mod 2 = 1 Then
Timer1.Enabled = True
Timer1.Interval = 100 '增加
Command1.Caption = "暂停"
Else
Timer1.Enabled = False
Command1.Caption = "演示"
'Timer1.Interval = 100 '删掉
Label1.Left = -Label1.Width
End If
End Sub