System.Windows.Forms.PreviewKeyDownEventArgs [HELP!]
Code:
Private Sub Page1_PreviewKeyDown(sender As Object, e As System.Windows.Forms.PreviewKeyDownEventArgs) Handles Page1.PreviewKeyDown
Select Case e.KeyCode
Case Keys.Q
My.Computer.Audio.Play(My.Resources.How_are_you, AudioPlayMode.Background)
End Select
End Sub
I have this, no errors whatsoever, and originated from my buttons code that worked fine, however I had to click a button for the hotkeys to start working so what I wanted to do was play sounds if the tab was active, yet this code doesn't seem to do anything at all. :confused:
Re: System.Windows.Forms.PreviewKeyDownEventArgs [HELP!]
Setup a break point on the line that plays the audio, if it doesn't ever get triggered then try setting the KeyPreview to True.