Key Press

BrandonMPSMI

Active member
Joined
Oct 8, 2008
Messages
43
Programming Experience
Beginner
I need to be able to use the keyboard for my calculator. I was just going to use an event that tests if the key was pressed and paste my code from the buttons blah blah blah.

Also I need to disable the enter buttons normal use. When I press it it presses the highlighted button on the form. I need it to perform the equal sub routine.
 
Use the form's KeyDown event for this, also if you have any TB's on the form add the TB's keydown event to the "Handles" part of the event so the 1 sub handles both control's keydown event.

Then use a Select Case the e.KeyCode variable to match it the the Key enumeration.
In each of the cases use the corresponding button's PerformClick() sub to have it run the code in it's Click event.
 
Back
Top