1

I'm working on an university project of a windows forms calculator with c#.

Is fully functional, but the question is.

Can I insert numbers in the main textBox without focusing on it. I want it to work like windows calculator and insert numbers without having to click the textbox.

I've try a lot of methods like using the event Key_Press directly on the form but nothing works.

Ps. Is like windows calculator.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
  • Unlike forum sites, we don't use "Thanks", or "Any help appreciated", or signatures on [so]. See "[Should 'Hi', 'thanks,' taglines, and salutations be removed from posts?](http://meta.stackexchange.com/questions/2950/should-hi-thanks-taglines-and-salutations-be-removed-from-posts). BTW, it's "Thanks in advance", not "Thanks in advantage". – John Saunders Mar 17 '15 at 06:35

1 Answers1

2

Set the Form.KeyPreview property to true and handle the Form_KeyPress event.

Sam Axe
  • 33,313
  • 9
  • 55
  • 89