DevExpress的DateEdit设置显示日期和时间
1. 设置Mask.EditMask和DisplayFormat,EditFormat属性。设置为一致:'yyyy-MM-dd HH:mm'; //依照想要的显示格式设置此字符串。
- this.dateEdit1.Properties.DisplayFormat.FormatString = "yyyy-MM-dd HH:mm";
- this.dateEdit1.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
- this.dateEdit1.Properties.EditFormat.FormatString = "yyyy-MM-dd HH:mm";
- this.dateEdit1.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
- this.dateEdit1.Properties.Mask.EditMask = "yyyy-MM-dd HH:mm";
2. 假设要显示时间须要设置VistaDisplayMode=true, VistaEditTime=true。意思为显示时间。在时间控件中会出现时钟图标,并能够编辑时间。
- this.dateEdit1.Properties.VistaDisplayMode = DevExpress.Utils.DefaultBoolean.True;
- this.dateEdit1.Properties.VistaEditTime = DevExpress.Utils.DefaultBoolean.True;
3. 设置时间部分的格式,时间部分指的是打开日期空间后,在时钟图标下的显示的日期格式。
- this.dateEdit1.Properties.VistaTimeProperties.DisplayFormat.FormatString = "HH:mm";
- this.dateEdit1.Properties.VistaTimeProperties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
- this.dateEdit1.Properties.VistaTimeProperties.EditFormat.FormatString = "HH:mm";
- this.dateEdit1.Properties.VistaTimeProperties.EditFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
- this.dateEdit1.Properties.VistaTimeProperties.Mask.EditMask = "HH:mm";
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvZW50ZXI4OQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" style="border: none; max-width: 100%;" />
该日期控件的设置全代码
- //
- // dateEdit1
- //
- this.dateEdit1.EditValue = new System.DateTime(2015, 6, 26, 14, 29, 8, 441);
- this.dateEdit1.Location = new System.Drawing.Point(24, 154);
- 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.DisplayFormat.FormatString = "yyyy-MM-dd HH:mm";
- this.dateEdit1.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
- this.dateEdit1.Properties.EditFormat.FormatString = "yyyy-MM-dd HH:mm";
- this.dateEdit1.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
- this.dateEdit1.Properties.Mask.EditMask = "yyyy-MM-dd HH:mm";
- this.dateEdit1.Properties.VistaDisplayMode = DevExpress.Utils.DefaultBoolean.True;
- this.dateEdit1.Properties.VistaEditTime = DevExpress.Utils.DefaultBoolean.True;
- this.dateEdit1.Properties.VistaTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
- new DevExpress.XtraEditors.Controls.EditorButton()});
- this.dateEdit1.Properties.VistaTimeProperties.DisplayFormat.FormatString = "HH:mm";
- this.dateEdit1.Properties.VistaTimeProperties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
- this.dateEdit1.Properties.VistaTimeProperties.EditFormat.FormatString = "HH:mm";
- this.dateEdit1.Properties.VistaTimeProperties.EditFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
- this.dateEdit1.Properties.VistaTimeProperties.Mask.EditMask = "HH:mm";
- this.dateEdit1.Size = new System.Drawing.Size(134, 21);
- this.dateEdit1.TabIndex = 5;
DevExpress的DateEdit设置显示日期和时间的更多相关文章
- Linux date命令 - 显示和设置系统日期与时间
操作系统上的时间也许只是当做一个时钟.特别在控制台下, 我们通常并不认为时间有什么重要的.但是对于管理员,这种认识是错误的.你知道错误的日期和时间会导致你不能编译程序么? 因为日期和时间很重要,这或许 ...
- CentOS下date命令 - 显示和设置系统日期与时间
显示系统日期 要显示系统日期,只要输入: $ date Thu Dec 5 22:55:41 WIB 2013 格式化显示日期 日期有很多格式.如果你不喜欢默认的格式,你可以换一种格式.你可能会想&q ...
- Android 通过应用设置系统日期和时间的方法
Android 通过应用设置系统日期和时间的方法 android 2.3 android 4.0 测试可行,不过需要ROOT权限. ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ...
- Devexpress MVC DateEdit 设置默认的Time
当用户没有选择日期的时候, 默认显示当前的时间给TimeEdit. 只有当用户选了日期后, 才会把时间带进去. 效果图: 实现 C# Helper Code public static Action& ...
- date - 打印或设置系统日期和时间
总览 date [选项]... [+格式] date [选项] [MMDDhhmm[[CC]YY][.ss]] 描述 根据指定格式显示当前时间或设置系统时间. -d, --date=STRING 显示 ...
- DevExpress 利用DateEdit 仅显示和选择年份 z
DevExpress只提供了选择月份的控件MonthEdit,并没提供选择选择年份的控件,目测是官方偷懒不想弄,因为要实现的方法也很简单,利用ComboBoxEdit添加年份数据即可,直接封装一个控件 ...
- [No000011A]Office Excel设置显示日期与星期
设置excel日期格式,自定义,yyyy-mm-dd 上午/下午 hh:mm:ss AM/PM dddd aaaa
- easyUi DataGrid 显示日期列,时间为空也可,的正常显示,及普通居中列情况
$('#tt').datagrid({ url: '@Url.Content("~/kpi/FindList")', w ...
- mysql 使用 unix 方式显示日期和时间
1.UNIX中文为时间戳.该方式显示从1970年1月1日开始经过的秒数. 2.函数 UNIX_TIMESTAMP() 返回时间戳格式的时间, FROM_UNIXTIME() 将时间戳格式的时间转换为普 ...
随机推荐
- linux软硬链接
ln分为软链接和硬链接 1.软连接 -s ln -s /mnt/hgfs/SHARE hvshare2 相当于在当前目录下新建一个名为hvshare2的快捷方式指向/mnt/hgfs/SHARE路 ...
- SSO之安装CAS Server
JA-SIG CAS(Central Authentication Service)为Web应用系统提供了单点登录服务.它的特性包括:一个开放和具有很好文档支持的协议:一个Java开源服务器组件:提供 ...
- Linux(CentOS)的server安装及配置图解(图文)
CentOS,据说这个如今在server上装机量非常大. 安装的分区划分 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdXBpMnU=/font/5a6L ...
- PHP-二进制文件和文本文件的区别
一.文本文件和二进制文件的定义 计算机上所有文件存储在存储设备上都是二进制的, 所以文本文件和二进制文件的区别并不是物理上的, 而是逻辑上的!简单来说, 文本文件是基于字符编码的文件, 常见的编码有A ...
- hdu--DFS
DFS Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submiss ...
- HDUOJ------1058 Humble Numbers
Humble Numbers Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)To ...
- 转 web前端性能分析--分析篇
通过具体实施后就可以获得第一手的web前端性能的数据了,然后每次新版本都跑,这就会获得大量的数据,为性能分析提供了基础的输入,同时应该还要综合使用多种工具去从不同的方向收集数据:比如showslow同 ...
- Es6 函数式编程 MayBe函子的简单示例
初级函子的作用非常简单,使用场景主要体现在:深入访问object的属性的时候,不会担心由于属性不存在.undefined.null等问题出现异常. MayBe.js var MayBe = funct ...
- unity, Find References In Scene
材质,脚本,shader等都可以通过Find References In Scene查看引用情况,如图. 当对一个文件点击Find References In Scene后,搜索命令会显示到Scene ...
- 用 Qt 中的 QDomDocument类 处理 XML 文件
XML,全称为 “可扩展标记语言”(extensible markup language).是一种非常方便的数据交换与数据存储的工具. 我们在取得一个XML格式的文件后,需要作句法分析去提取发布方提供 ...