读书人

怎么响应小键盘下的quot;quot;按钮

发布时间: 2012-11-07 09:56:10 作者: rapoo

如何响应小键盘上的"-"按钮
就是普通键盘最右上角的那个
keyData 要等于什么好? 谢谢~~

[解决办法]
看这不敢恭维的结帖率.....
e.keyData==Keys.Subtract
[解决办法]
看 Keys 枚举 帮助,里面都列着呢
[解决办法]
case Keys.OemPeriod: case Keys.Decimal: // 小数点
text.Text += '.';
return true;
case Keys.Back: // 退格
if (text.Text.Length > 0) text.Text = text.Text.Substring(0, text.Text.Length - 1);
return true;
case Keys.Escape: case Keys.C: // Esc 或 C
text.Text = null;
return true;
case Keys.OemMinus: case Keys.Subtract: // -
MessageBox.Show("您按了“-”键!");
return true;

读书人网 >C#

热点推荐