Hello I am working on a simple calculator program for school. I already have all the button clicks working, which is all that was required.
I thought it would be cool if I could get it to where you could use the keyboard for entry and I've done similar things with Visual Basic (which I learned in high school).
I looked online and found the syntax (I'm pretty sure its right) but for some reason it's not sensing a keypress event.
This is the code I have right now, I just want to get the keypress working, I already know how to do the specifics inside the event once it is working.
Oh and I do have keypreview enabled on my form.
private void calculator_KeyPress(object sender, System.Windows.Forms.KeyEventArgs e)
{
textBox1.Text = "key pressed";
}
Thanks in advance for the help and like I said, Its already done as far as the assignment was, I just want to learn how to do this.