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

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

原文地址:https://www.cnblogs.com/liancs/p/3879298.html