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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -