Voici mon dilemme : voici le code que j'ai :
If e.KeyCode = Keys.A Then
TextBox1.AppendText("C, ")
PictureBox2.Visible = True
My.Computer.Audio.Play(My.Resources.C, AudioPlayMode.Background)
End If
Maintenant, lorsque j'entre ceci sous Form1_KeyDown, visual basic pense ceci :
'KeyCode n'est pas un membre de 'System.EventArgs'
J'ai déjà vu ce code fonctionner, mais ce n'est pas le cas ici. Un coup de main ?
Voici le code complet :
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
If e.KeyCode = Keys.A Then
TextBox1.AppendText("A, ")
PictureBox2.Visible = True
My.Computer.Audio.Play(My.Resources.C, AudioPlayMode.Background)
End If
If e.KeyCode = Keys.S Then
TextBox1.AppendText("C,")
PictureBox14.Visible = True
My.Computer.Audio.Play(My.Resources.D, AudioPlayMode.Background)
End If
End Sub