日期:2014-05-20 浏览次数:20767 次
if (!System.Text.RegularExpressions.Regex.IsMatch((sender as TextBox).Text, @"^(?!0\d)\d+(\.\d*)?$")) { int index = (sender as TextBox).SelectionStart; (sender as TextBox).Text = (sender as TextBox).Tag as string; (sender as TextBox).SelectionStart = index; }
@"^(?!0\d)\d+$"