日期:2014-05-17  浏览次数:20816 次

如何响应小键盘上的"-"按钮
就是普通键盘最右上角的那个 
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;