4
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by WaltP
0

You have to work on the event "Form_KeyDown()".
By reading each "keycode" and then playing a specific sound using the "Microsoft Multimedia Control"

Where the "Sound" would be an audio file.(ex mp3,wma,etc)

Hope that helps :)

0

You have to work on the event "Form_KeyDown()".
By reading each "keycode" and then playing a specific sound using the "Microsoft Multimedia Control"

KSS is correct but just to show you what he means i've written a short piece of code

Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        Select Case e.KeyCode
            Case Keys.A
                'play note A
            Case Keys.B
                'play note B
        End Select
    End Sub

This was written in the Form_Keydown() event.

"Select Case e.KeyCode" - This is a type of Conditional statement but its better for large numbers of conditions rather than writing out lots of If statements

"Case keys.A" - This means that in the Case of the key "A" being pressed the code beneath it (in this case "'Plays note A" will be executed


Hope this was helpful

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.