I need help making some key that if the "a" key is pressed it plays a sound.

All the tutorials ive seen confuse me so maybe you can help. I've tried a few things but am still confused.

Thanks!

Recommended Answers

All 3 Replies

first of all you need to set KeyPreview to True in the Form Properties.
Then you need to click on KeyDown in Event and then in there you do

if (e.KeyCode == Keys.A)
{
     PlaySound();
}

Here I was feeling nice

If solved please mark as solved,

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.