我才看到试着做了一下
Private i As VariantPrivate Sub Command2_Click()
Timer1.Enabled = True
Command1.Enabled = False
End Sub
Private Sub Form_Load()
label1.FontSize = 20
Timer1.Enabled = False
End Sub
Private Sub Command1_Click()
If i Then
label1.Left = label1.Left + 100
If label1.Left > 3000 Then
i = 0
End If
Else
label1.Left = label1.Left - 100
If label1.Left < 0 Then
i = 1
End If
End If
End Sub
Private Sub Timer1_Timer()
If i Then
label1.Left = label1.Left + 100
If label1.Left > 3000 Then
i = 0
End If
Else
label1.Left = label1.Left - 100
If label1.Left < 0 Then
i = 1
End If
End If
End Sub