【发布时间】:2018-06-11 14:03:18
【问题描述】:
在listBox_KeyDown 中,我评估e.KeyCode 条件。但它会检测大写字符而不是小写字母(实际上是输入的)。我如何让它捕捉输入的实际字符?代码如下:
bool isLetterOrDigit = char.IsLetterOrDigit((char)e.KeyCode);
if (isLetterOrDigit == true)
{
//Add the char to textBox
txtINAME.Text += (char)e.KeyCode;
}
【问题讨论】:
-
或者,如果这是关于 WPF(很难说)see this
标签: c# visual-studio-2015 textbox listbox keydown