| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
-
- using System.ComponentModel;
- using System.Drawing;
- using System.Windows.Forms;
- namespace Dongke.WinForm.Controls
- {
- /// <summary>
- /// 邮编输入文本框
- /// </summary>
- [ToolboxBitmap(typeof(TextBox))]
- public class TxtZipCode : TextBoxCodeBase
- {
- #region 构造函数
- /// <summary>
- /// 邮编输入文本框
- /// </summary>
- public TxtZipCode()
- {
- this.Rejected = "[^0-9]";
- this.Regular = @"^[1-9]\d{5}$";
- this.MaxLength = 6;
- }
- #endregion
- #region 重写属性
- /// <summary>
- /// 获取或设置用户可在文本框控件中键入或粘贴的最大字符数。
- /// </summary>
- [Browsable(false)]
- [EditorBrowsable(EditorBrowsableState.Never)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public override int MaxLength
- {
- get
- {
- return base.MaxLength;
- }
- set
- {
- base.MaxLength = value;
- }
- }
- /// <summary>
- /// 获取或设置允许输入的最小长度。
- /// </summary>
- [Browsable(false)]
- [EditorBrowsable(EditorBrowsableState.Never)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public override int MinLength
- {
- get
- {
- return base.MinLength;
- }
- set
- {
- base.MinLength = value;
- }
- }
- #endregion
- }
- }
|