开发者

Why does setting a Winforms DateTimePicker to DateTime.MinValue fail?

开发者 https://www.devze.com 2023-04-05 13:48 出处:网络
I have the following code in my Winf开发者_StackOverflow社区orms OnLoad event: dtpStartDateFilter.Value = DateTime.MinValue;

I have the following code in my Winf开发者_StackOverflow社区orms OnLoad event:

dtpStartDateFilter.Value = DateTime.MinValue;

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).

What's wrong with doing this?


DateTimePicker.MinimumDateTime > DateTime.MinValue

DateTime.MnValue

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

DateTimePicker.MinimumDateTime

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号