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() 将时间戳格式的时间转换为普 ...
随机推荐
- tensorflow的警告
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_featur ...
- 推荐系统之 BPR 算法及 Librec的BPR算法实现【1】
[推荐系统之 BPR 算法] 1.关于BPR的论文原文: BPR: Bayesian Personalized Ranking from Implicit Feedback 2.参考1:论文快读 - ...
- eclipse安装插件的方式 三种:links、eclipse中使用插件安装向导安装、直接copy插件到对应的eclipse目录 MyEclipse10安装SVN插件
myeclipse安装插件 1.直接将插件copy到myeclipse目录下的dropins目录下(没有目录就新建一个),重启,详细参考 MyEclipse使用总结——MyEclipse10安装SVN ...
- java多线程学习--java.util.concurrent
CountDownLatch,api 文档:http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/CountDownLatch.h ...
- tcp流协议产生的粘包问题和解决方案
我们在前面曾经说过,发送端可以是一K一K地发送数据,而接收端的应用程序可以两K两K地提走数据,当然也有可能一次提走3K或6K数据,或者一次只提走几个字节的数据,也就是说,应用程序所看到的数据是一个整体 ...
- spring 多线程
http://blog.csdn.net/chszs/article/details/8219189 一.ThreadPoolTaskExecutor ThreadPoolTaskExecutor的配 ...
- sklearn 中的交叉验证
sklearn中的交叉验证(Cross-Validation) sklearn是利用python进行机器学习中一个非常全面和好用的第三方库,用过的都说好.今天主要记录一下sklearn中关于交叉验证的 ...
- C# ASCII码排序
将字典变成post参数 public static string GetSignContent(IDictionary<string, string> parameters) { // 第 ...
- 多进程对 MySQL update的影响
今天要做数据清洗的时候,要更新一个数据库字段,考虑到用多进程去更新数据库,也许程序会跑得快一些,结果开了64个进程, 结果是其他程序更新的时候,速度非常慢,最后发现的原因是,数据库中有64个SQL语句 ...
- IP和java.net.InetAddress类的使用
一.IP 1.地址格式 互联网上每一台计算机都有一个唯一标示自己的标记,这个标记就是IP地址.IP 地址使用32 位长度二进制数据标示,一般在实际中看到的大部分IP地址都是以十进制的数据形式标示的,如 ...