0

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;
}
Salah Akbari
  • 39,330
  • 10
  • 79
  • 109
Prasad Kamath
  • 182
  • 2
  • 15
  • Or, if this is about WPF (hard to tell) [see this](https://stackoverflow.com/questions/12591793/get-lowercase-with-keydown-wpf) – Salem Jun 11 '18 at 06:03

1 Answers1

1

Use the KeyPress event, it has a KeyChar property in the KeyPressEventArgs. It will get you the actual character being pressed

rayh
  • 103
  • 1
  • 8