Question regarding the "KeyDown Event" ?
Hi,
As you can see from the code below, I've included this code on a form which changes the backcolor to blue every time I press the "a" key on the keyboard.
When the key is released it changes the form color back to gray.
My questions are;
1. How do I make it respond only at the pressing of a capital "A" key?
2. What code do I use to quit the program by pressing the "F10" key?
3. What code do I use to display another form?
Thanks,
Rastin
My code for QUESTION 1.
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyA
Form1.BackColor = vbBlue
End Select
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
Form1.BackColor = vbGray
End Sub