tags:

views:

2664

answers:

4

How to convert keycode to keychar in .net?

+1  A: 

In vb.net

ChrW(70)

in c# you can cast

(char) 70
Ady
+2  A: 
Convert.ToChar(65)
pablito
This is not correct (like all other answers so far). It might work for the capitol 'A', but it fails e.g. for key combinations and for the numbers on the numpad. A possible solution is to listen to the `KeyPress` event in Windows Forms or to the `TextInput` event in WPF/Silverlight.
0xA3
A: 

String.fromCharCode(event.keyCode)

This is Javascript, not .NET, for anyone looking at this.
x4000
A: 

Convert.ToChar(Keys.Enter);

DaveH