As far as I know, these are the only keys that react when a button has focus.
Pressing Enter instantly 'clicks' the button, even if you keep it the key down. (So the 'click' happens on KeyDown).
Pressing Space acts more like a normal mouse click; holding it down doesn't activate the Click event, but it does once you release it. (So the 'click' happens on KeyUp or KeyPressed.)
Why the difference? I'd like a good article on the subject or simply a logical explanation as to why those two keys have different behavior. Surely there's an explanation out there!
MessageBox
. Enter and space both click the focused button, but with the behavior described above.MessageBox
with buttons such as OK and CANCEL, YES and NO. The button with the focus (Let's say it's CANCEL) will get activated when you press enter, thus cancelling and closing.