I'm trying to make my program execute "stuff" when I press a key such as F1 (or any other key I choose) I want to do this WITHOUT shortcuts, so that i can later do it without having an object heres what I have so far
VB Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'adds the handler and sets address only works when it's in the text box AddHandler txtmacro.KeyPress, AddressOf key End Sub Public Sub key(ByVal o As System.Object, ByVal e As KeyPressEventArgs) 'Checks to see when the letter "a" is pressed and then does "stuff" If e.KeyChar = Microsoft.VisualBasic.ChrW(97) Then Stuff End If End Sub
Now this works fine under 2 condittions
1)I'm typing in my text box
2)I use a key that has a common ascii code such as a-z A-Z or 0-9
When i put in "&H6F" for the key (which I thought was the F1 key) It doesnt give me any errors but it doesnt do the "stuff"
Also I would like for this to work at any time, and not just when the cursor is in the text box.
Any help or suggestions would be greatly appreciated
even if you have a completely differant way of doing this, as long as it works that's great.
Any questions please ask!!
