Skúste toto:
Public Class Form1
Dim zvuk As String
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
Dim random As New Random()
Dim i As Integer = random.Next(3) + 1
Select Case i
Case 1
zvuk = "jeden"
Case 2
zvuk = "dva"
Case 3
zvuk = "tri"
End Select
My.Computer.Audio.Play("c:\" & zvuk & ".wav", AudioPlayMode.Background)
End Sub
End Class
Pričom adresa prvého zvuku je c:\jeden.wav A zaregistrujte sa, prosím.
|