Guest User

Untitled

a guest
May 23rd, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. If e.KeyCode = Keys.A Then
  2. TextBox1.AppendText("C, ")
  3. PictureBox2.Visible = True
  4. My.Computer.Audio.Play(My.Resources.C, AudioPlayMode.Background)
  5. End If
  6.  
  7. Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
  8. If e.KeyCode = Keys.A Then
  9. TextBox1.AppendText("A, ")
  10. PictureBox2.Visible = True
  11. My.Computer.Audio.Play(My.Resources.C, AudioPlayMode.Background)
  12. End If
  13. If e.KeyCode = Keys.S Then
  14. TextBox1.AppendText("C,")
  15. PictureBox14.Visible = True
  16. My.Computer.Audio.Play(My.Resources.D, AudioPlayMode.Background)
  17. End If
  18. End Sub
  19.  
  20. Private Sub foo_KeyDown(sender As Object, e As KeyEventArgs)
  21. If e.KeyCode = Keys.A Then
  22. TextBox1.AppendText("A, ")
  23. PictureBox2.Visible = True
  24. My.Computer.Audio.Play(My.Resources.C, AudioPlayMode.Background)
  25. ElseIf e.KeyCode = Keys.S Then
  26. TextBox1.AppendText("C,")
  27. PictureBox14.Visible = True
  28. My.Computer.Audio.Play(My.Resources.D, AudioPlayMode.Background)
  29. End If
  30. End Sub
  31.  
  32. Private Sub Form1_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs)
  33. // code here
  34. End Sub
  35.  
  36. Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
  37. MsgBox(e.KeyCode.ToString()) 'Message what the keycode
  38. If (e.KeyCode = Keys.A) Then
  39. MsgBox("e.KeyCode = Keys.A") 'Message that I've found the A
  40. TextBox1.AppendText("C, ")
  41. PictureBox2.Visible = True
  42. My.Computer.Audio.Play(My.Resources.C, AudioPlayMode.Background)
  43. End If
  44.  
  45. Private Sub TextBoxKeyTest_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBoxKeyTest.KeyDown
  46. MsgBox(e.KeyCode.ToString())'Message what the keycode
  47. If (e.KeyCode = Keys.A) Then
  48. MsgBox("e.KeyCode = Keys.A")'Message that I've found the A
  49. TextBox1.AppendText("C, ")
  50. PictureBox2.Visible = True
  51. My.Computer.Audio.Play(My.Resources.C, AudioPlayMode.Background)
  52. End If
  53. End Sub
Add Comment
Please, Sign In to add comment