L
Lucky Hyena
Guest
Hello, I am trying to detect when a specific key is pressed. Here is my current code:
Private Sub Form1_Keydown(sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp
If e.KeyCode = System.Windows.Forms.Keys.Alt Then
MessageBox.Show("alt key pressed")
End If
End Sub
Whenever I try to use e.KeyCode = Keys.Enter, I receive an error that states 'Enter is not a property of Keys'. When I use the code above there is no response at all. I have many questions as how it should fucntion. Will it be whenever the alt key is pressed? Do I have to call the function? I am trying to allow the user to save changes to an access database file whenever they press the alt key. Thanks.
Continue reading...
Private Sub Form1_Keydown(sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp
If e.KeyCode = System.Windows.Forms.Keys.Alt Then
MessageBox.Show("alt key pressed")
End If
End Sub
Whenever I try to use e.KeyCode = Keys.Enter, I receive an error that states 'Enter is not a property of Keys'. When I use the code above there is no response at all. I have many questions as how it should fucntion. Will it be whenever the alt key is pressed? Do I have to call the function? I am trying to allow the user to save changes to an access database file whenever they press the alt key. Thanks.
Continue reading...