private void textBox1_KeyUp(object sender, KeyEventArgs e)
{
var textBox = (sender as TextBox);
if (textBox == null) return;
textBox.Text = Regex.Replace(textBox.Text,"[^\\d\\.]+","");
textBox.SelectionStart = textBox.Text.Length;
}
posted on 2013-06-13 08:45
sanmao 阅读(1029)
评论(0) 编辑 收藏