1、设置textbox属性InputMethod.IsInputMethodEnabled="False"
2、增加KeyDown事件
private void TextBox_KeyDown(object sender, KeyEventArgs e) { #region --对输入中文就没办法屏蔽,可以在Textbox添加属性InputMethod.IsInputMethodEnabled="False"-- //屏蔽非法按键 if (e.Key >= Key.NumPad0 && e.Key <= Key.NumPad9) { e.Handled = false; } else if (e.Key >= Key.D0 && e.Key <= Key.D9) { e.Handled = false; } else { e.Handled = true; } #endregion }