You already know how to do that because it was the point of this thread in the first place. You just have to put the code in that form. Putting code in Form1 to access Buttons on a different form is no use. If the form containing those Buttons has focus then it will be raising the keyboard events so you must handle the events of that form.