摘要:
1. 在KeyDown事件中屏蔽非法按键。private void TextBox_KeyDown(object sender, KeyEventArgs e){ TextBox txt = sender as TextBox; if ((e.Key >= Key.NumPad0 && e.Key <= Key.NumPad9) || e.Key == Key.Decimal) { if (txt.Text.Contains(".") && e.Key == Key.Decimal) { e.Handled = true; ret 阅读全文
posted @ 2011-08-18 15:41 StarSoul 阅读(822) 评论(0) 推荐(0)