Students helping students, join us in improving Bored of Studies by donating and supporting future students!
With something like that, 13 is the code for the enter key, kind of thing, I think...Originally posted by del
Use the KeyPress method of a Form using selection statements to check which key is pressed.....
example:
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 10
Label1.Left = Label1.Left + 100
End If
End Sub
...
So you should use KeyDown, rather than KeyPress....The KeyDown event should be used only when you need to detect a function key or arrow key or the the shift, alt or ctrl keys (these keys do not have ASCII codes and therefore do not generate KeyPress events. KeyPreview does not work for the KeyDown event, which in this example is therefore passed to the picturebox.
Select Case (INPUT)
Case 1, 4, 60 to 90
'Some Commang
Case 99 to 102
'Another Command
Case is < 0
'Yet Another Command
End Select
private sub timer()
timCount = timCount + 1
If timCount = 60 then timer.enabled = false
end sub