I have a form with a readonly textbox, some layoutpanels with some buttons in it and together they make up a calculator. (Yes I know this is YAC (yet another...)) but I have fun while still learning!
When I click the buttons and manipulate the Text property of the textbox, al is well.
Now I like to use keyboard input also, but I don't seem to get a grab at the KeyDown event. My textbox obviously does not have Focus, but which control has?
What am I doing wrong or how should I proceed?
Jump to Post
Are you using the form's KeyDown or the control's KeyDown event?
Since this is a calculator i'm guessing you want to catch when a user presses "*" regardless of what control has focus to handle the event. In this case you should handle the form's KeyDown event.
All 4 Replies
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.