Tuesday, October 7, 2008

this is a private sub for the keydown event

Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.A Then
whichKey = 0
ElseIf e.KeyCode = Keys.B Then
whichKey = 1
ElseIf e.KeyCode = Keys.C Then
whichKey = 2
ElseIf e.KeyCode = Keys.D Then
whichKey = 3
ElseIf e.KeyCode = Keys.E Then
whichKey = 4
ElseIf e.KeyCode = Keys.F Then
whichKey = 5
ElseIf e.KeyCode = Keys.Space Then
whichKey = 26
ElseIf e.KeyCode = Keys.F11 Then
MsgBox("Do you want to save your label?")
allTheWords = secretCode.Text
wordsGoHere.Text = allTheWords
wordsGoHere.Visible = True
End If
secretCode.Text = secretCode.Text & CodeKeys(whichKey)

End Sub

No comments: