I have a piano in which when I press a button, a certain sound is played.
How to make it so that when you press and hold on a key, button1.PerformClick(); It worked 1 time and the sound did not repeat.
private void Form1_KeyDown(Object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.D1: button1.PerformClick(); button1.BackColor = System.Drawing.Color.Gray; label3.Text = "До / 1"; label5.Text = "1"; break; } }