I have this code:
the bp is a private array just like the bttn but the audio doesnt work. in the beep(l) the l represents a random number and it should work like this is the random number is 4Code:For i As Integer = 1 To 4 Dim btn As Control = Me.Controls("button" & i.ToString()) bttn.Add(btn) Dim beepx As String = "My.Resources.beep" & i.ToString() beep.Add(beepx) Next If Form2.sound = True Then My.Computer.Audio.Play(beep(l), AudioPlayMode.Background) End If
My.Computer.Audio.Play(My.Resources.beep4, AudioPlayMode.Background)
even though the beep(l) has the value of "My.Resources.beep4" it just gives an exeption on runtime, I figured it would be possible since the my.resources.beepX is the location as string.
does anyone know whats going on here?




Reply With Quote