I'm trying to make a button change its fore color when we press a key. Like button's name is "A" and we press A it changes the fore color into red, then we release the key it turns back to its default color. But I can't find any such event. Thank you! :D
It's KeyDown, KeyPress, and KeyUp event you should use.
Refer to this link.
http://csharp.net-informations.com/gui/key-press-cs.htm
If you want to capture a key typed anywhere on a form, you can use Keydown, KeyPress and KeyUp like ydoow said, but you will also have to set the form's KeyPreviewproperty to true to make sure your events are raised even if a key is typed while in a specific control.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With