Private Declare Function APIBeep Lib "kernel32" Alias "Beep" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Dim n As Long
Private Sub Form_Load()
For i = 0 To 19
Picture1(i).Visible = False
Next
End Sub
Private Sub Timer1_Timer()
Dim temp As Integer
temp = Int(20 * Rnd)
n = n + 1
If n = 4 Then
Picture1(temp).Visible = True
APIBeep 2000 * Rnd, 1000 * Rnd '不同的声音效果
n = 0
End If
Picture1(temp).Visible = False
End Sub