Option Explicit
Private Sub Command1_Click() '复原
Text1.Text = ""
Shape1.BackColor = vbRed
Timer1.Enabled = False
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer) '在文本框中输入时间(单位秒,不能超过65秒),回车确认
If KeyAscii = 13 Then
Timer1.Interval = Val(Text1.Text) * 1000
Timer1.Enabled = True
End If
End Sub
Private Sub Timer1_Timer()
Shape1.BackColor = vbBlue '变为红色
End Sub