Dim start As Boolean
Dim time As Byte
Dim msg As Integer
Dim x As Byte
Private Sub Command1_Click()
start = True
If Command1.Caption = "stop" Then
start = False
Command1.Caption = "start"
End If
End Sub
Private Sub Command2_Click()
CommonDialog1.ShowOpen
Image1(0).Picture = LoadPicture(CommonDialog1.FileName)
CommonDialog1.ShowOpen
Image1(1).Picture = LoadPicture(CommonDialog1.FileName)
CommonDialog1.ShowOpen
Image1(2).Picture = LoadPicture(CommonDialog1.FileName)
End Sub
Private Sub Form_Load()
time = 30
start = False
x = 0
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 58) And (KeyAscii <> 8 And KeyAscii <> 13) Then KeyAscii = 0
If KeyAscii = 13 Then
start = True
Timer1.Interval = Text1.Text
End If
End Sub
Private Sub Timer1_Timer()
If time = 0 Then
For i = 0 To 2
Image1(i).Visible = True
Next
End If
If start = True Then
If time > 20 Then
Image1(0).Visible = True
Image1(1).Visible = False
Image1(2).Visible = False
End If
If (time > 10 And time < 20) Then
Image1(0).Visible = False
Image1(1).Visible = True
Image1(2).Visible = False
End If
If (time > 0 And time < 10) Then
Image1(0).Visible = False
Image1(1).Visible = False
Image1(2).Visible = True
End If
Command1.Caption = "stop"
time = time - 1
Label1.Caption = time
If time = 0 Then
start = False
msg = MsgBox("end time other game", vbYesNo)
If msg = vbYes Then
time = 30
Label1.Caption = 30
Else
start = False
End If
End If
End If
End Sub