how to use KeyValue in KeyPress event in C# -


in key press event can use keychar property , in keydown event can use keyvalue. need use keyvalue , keychar property in keypress event. how can it?

you can not access keyvalue in keypress event. can use keydown event instead. can use keyvalue , e.keycode.tostring() keychar.

in keydown event : e.keycode.tostring() = keychar

example:

private void yourcontrol_keydown(sender object, e keyeventargs)  {     var keychar = e.keycode.tostring()     var keyvalue = e.keyvalue } 

Comments

Popular posts from this blog

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -