The question
how to get inputs from the keyboard in a form which has a button? is getting bad advice. The person asking the question obviously does not understand how Windows works. They are trying to use Windows Forms for a game but
they are totally unfamiliar with the use of the keyboard in Windows.
I even reported one post (from a moderator) as abusive because it is such bad advice. I hope that is appropriate. The post suggests using the key preview event to get keyboard messages for the form. Yet the person only has a picture control
and a button in the form. My reply is to use an appropriate
control. I think the question should be clarified; it is not clear what the person is actually trying to do. They should first be guided to use an
appropriate control.
There is also a reply in that thread suggesting to use a message loop. I won't say what I really think about that. I really, really hope that the question gets the attention of experts that will guide the people in the right direction; currently there is
too much lousy advice in that thread.
Sam Hobbs
SimpleSamples.Info