为什么设定一个WinForms的DateTimePicker到DateTime.MinValue失败? [英] Why does setting a Winforms DateTimePicker to DateTime.MinValue fail?

查看:171
本文介绍了为什么设定一个WinForms的DateTimePicker到DateTime.MinValue失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的WinForms OnLoad事件下面的代码:

I have the following code in my Winforms OnLoad event:

dtpStartDateFilter.Value = DateTime.MinValue;



dtpStartDateFilter 是一个标准的WinForms日期时间选择器。当我的形式加载它遇到以前输入的代码行,然后退出(与WinForms的饮食异常,所以我不知道它是什么)。

dtpStartDateFilter is a standard WinForms date time picker. When my form loads it encounters the previously entered code line and then exits (with WinForms eating the exception so I have no idea what it is).

这有什么错这样做?

推荐答案

DateTimePicker.MinimumDateTime> DateTime.MinValue

DateTimePicker.MinimumDateTime > DateTime.MinValue

<一个HREF =http://msdn.microsoft.com/en-us/library/system.datetime.minvalue.aspx相对=nofollow> DateTime.MnValue

此常数的值等于00:00:00.0000000,一月
1,0001

The value of this constant is equivalent to 00:00:00.0000000, January 1, 0001.

DateTimePicker.MinimumDateTime

这可以在控制被选择的最低的日期和时间。在
默认值是1753年1月1日00:00:00。

The minimum date and time that can be selected in the control. The default is 1/1/1753 00:00:00.

这篇关于为什么设定一个WinForms的DateTimePicker到DateTime.MinValue失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆