In listBox_KeyDown
, I evaluate the e.KeyCode
condition. But it detects Upper-case characters instead of the lower-case (which is actually typed). How do I get it to capture the actual character typed? Code follows:
bool isLetterOrDigit = char.IsLetterOrDigit((char)e.KeyCode);
if (isLetterOrDigit == true)
{
//Add the char to textBox
txtINAME.Text += (char)e.KeyCode;
}
Use the KeyPress
event, it has a KeyChar
property in the KeyPressEventArgs
. It will get you the actual character being pressed