摘要: 1 public class TextBoxDouble : TextBox 2 { 3 public TextBoxDouble() 4 { 5 KeyDown += TextBoxDouble_KeyDown; 6 TextChanged += TextBoxDouble_TextChanged; 7 } 8 9 private void TextBoxDouble_TextChanged(object sender, TextChangedEventArg... 阅读全文
posted @ 2013-12-03 13:33 CandyZkn 阅读(1212) 评论(0) 推荐(0) 编辑
摘要: 1 public class TextBoxInt : TextBox 2 { 3 public TextBoxInt() 4 { 5 KeyDown += TextBoxInt_KeyDown; 6 TextChanged += TextBoxInt_TextChanged; 7 } 8 9 private void TextBoxInt_TextChanged(object sender, TextChangedEventArgs e)10 {... 阅读全文
posted @ 2013-12-03 13:29 CandyZkn 阅读(1216) 评论(0) 推荐(0) 编辑
摘要: 1 /// 2 /// 使用正则表达式限制输入 3 /// 4 public class TextBoxRegex : TextBox 5 { 6 // 正则表达式,只含有汉字、数字、字母、下划线不能以数字开头 7 private const string NamimgPattern = "^(?![0-9])[a-zA-Z0-9_\u4e00-\u9fa5]{1,30}$"; 8 9 public TextBoxRegex()10 {11 TextCha... 阅读全文
posted @ 2013-12-03 12:14 CandyZkn 阅读(1818) 评论(0) 推荐(0) 编辑