WPF 禁止在文本框中输入数字

private void textBox1_PreviewTextInput(object sender, TextCompositionEventArgs e)
         {
             e.Handled = System.Text.RegularExpressions.Regex.IsMatch(e.Text, @"[0-9]+");
             base.OnPreviewTextInput(e);
         }

 

posted @ 2012-08-27 17:11  平民总有崛起的时候  阅读(358)  评论(0编辑  收藏  举报