您的位置:首页 > 编程语言 > C#

dev日期控件输入格式yyyyMMdd和yyyy-MM-dd笔记

2018-01-02 23:01 711 查看
  =====================(yyyyMMdd)==============================
this.dateEdit1.EditValue = null;

            this.dateEdit1.Location = new System.Drawing.Point(100, 125);

            this.dateEdit1.Name = "dateEdit1";

            this.dateEdit1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {

            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});

            this.dateEdit1.Properties.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {

            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});

            this.dateEdit1.Properties.CalendarTimeProperties.EditFormat.FormatString = "yyyyMMdd";

            this.dateEdit1.Properties.DisplayFormat.FormatString = "yyyyMMdd";

            this.dateEdit1.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom;

            this.dateEdit1.Properties.EditFormat.FormatString = "yyyyMMdd";

            this.dateEdit1.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Custom;

            this.dateEdit1.Properties.Mask.AutoComplete = DevExpress.XtraEditors.Mask.AutoCompleteType.None;

            this.dateEdit1.Properties.Mask.EditMask = resources.GetString("dateEdit1.Properties.Mask.EditMask");

            this.dateEdit1.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.RegEx;

            this.dateEdit1.Properties.Mask.ShowPlaceHolders = false;

            this.dateEdit1.Size = new System.Drawing.Size(179, 20);

            this.dateEdit1.TabIndex = 5;
=====================(yyyy-MM-dd)==============================
this.dateEdit1.EditValue = null;

            this.dateEdit1.Location = new System.Drawing.Point(100, 125);

            this.dateEdit1.Name = "dateEdit1";

            this.dateEdit1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {

            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});

            this.dateEdit1.Properties.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {

            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});

            this.dateEdit1.Properties.CalendarTimeProperties.EditFormat.FormatString = "yyyy-MM-dd";

            this.dateEdit1.Properties.DisplayFormat.FormatString = "yyyy-MM-dd";

            this.dateEdit1.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom;

            this.dateEdit1.Properties.EditFormat.FormatString = "yyyy-MM-dd";

            this.dateEdit1.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Custom;

            this.dateEdit1.Properties.Mask.AutoComplete = DevExpress.XtraEditors.Mask.AutoCompleteType.None;

            this.dateEdit1.Properties.Mask.EditMask = "(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)";

            this.dateEdit1.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.RegEx;

            this.dateEdit1.Properties.Mask.ShowPlaceHolders = false;

            this.dateEdit1.Size = new System.Drawing.Size(179, 20);

            this.dateEdit1.TabIndex = 5;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c#
相关文章推荐