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
Post a Comment