So what I wanted to do is: When I press the key F9 for example, the program would automatically "press" the enter key and write some text in an active program (notepad,word,etc..)
I tried doing this with the KeyDown event but it didn't work, here's my code:
Public Class Form1
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.F9 Then
SendKeys.Send("{Enter}")
SendKeys.Send("You pressed F9")
End If
End Sub
End Class
Can anyone tell me what I did wrong?

New Topic/Question
Reply



MultiQuote





|