Posted By

connorjackson on 10/30/10


key VBNet press

Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

D4RKCODE KeyPress Events

 / Published in: VB.NET

Add this code into the KeyDown event for the form, (e.g Private Sub frmMainGame_KeyDown...) then add the code where the comments go.

  1. If e.KeyCode = Keys.Left Then
  2. 'when left pressed
  3. ElseIf e.KeyCode = Keys.Right Then
  4. 'when right pressed
  5. ElseIf e.KeyCode = Keys.Space Then
  6. 'when space pressed
  7. End If

Report this snippet  

You need to login to post a comment.