如何改变一个.NET的DateTimePicker控件允许输入空值?控件、NET、DateTimePicker

2023-09-02 10:32:23 作者:清川带长薄

什么是改变.NET DateTimePicker控件,允许用户输入值的最简单,最可靠的方法是什么?

What's the easiest and most robust way of altering the .NET DateTimePicker control, to allow users to enter null values?

推荐答案

下面是一个有趣的文章上$ C $的CProject 。笔者拥有的覆盖Value属性接受空值DateTime.MinValue ,同时保持MINVALUE和标准控制的MaxValue的验证。这是所有有给它。

Here is an interesting article on CodeProject. The author has overridden the Value property to accept Null value as DateTime.MinValue, while maintaining the validation of MinValue and MaxValue of the standard control. That's all there's to it.