Difference of Keypress and KeyDown event

  • Thread starter Thread starter windy
  • Start date Start date
W

windy

What's the difference between Keypress and KeyDown event?
looks like some key cannot be handled by both event.
Can anyone list out the details and their usage for best pratice?
 
KeyPress is invoked only for character (printable) keys where as KeyDown is
raised for nonprintable such as Control, Shift, etc.

If you want to filter character input (such as allowing only numeric) then
KeyPress is a better choice.
 
Back
Top