Devi mettere tutto nell'evento KeyDown delle textbox:
codice:
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKey1 Or vbKeyNumpad1 Then PlaySound "c:\corsovb6 \inizio.WAV", ByVal 0&, SND_FILENAME Or SND_ASYNC
If KeyCode = vbKey2 Or vbKeyNumpad2 Then PlaySound "c:\corsovb6\inizio.WAV", ByVal 0&, SND_FILENAME Or SND_ASYNC
If KeyCode = vbKey3 Or vbKeyNumpad3 Then PlaySound "c:\corsovb6 \inizio.WAV", ByVal 0&, SND_FILENAME Or SND_ASYNC
End Sub
codice:
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKey1 Or vbKeyNumpad1 Then PlaySound "c:\corsovb6 \fine.WAV", ByVal 0&, SND_FILENAME Or SND_ASYNC
If KeyCode = vbKey2 Or vbKeyNumpad2 Then PlaySound "c:\corsovb6\fine.WAV", ByVal 0&, SND_FILENAME Or SND_ASYNC
If KeyCode = vbKey3 Or vbKeyNumpad3 Then PlaySound "c:\corsovb6 \fine.WAV", ByVal 0&, SND_FILENAME Or SND_ASYNC
End Sub
Ciao, fai sapere!