如何改变一个.NET的DateTimePicker控件允许输入空值? [英] How to alter a .NET DateTimePicker control to allow enter null values?

查看:279
本文介绍了如何改变一个.NET的DateTimePicker控件允许输入空值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是改变.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.

这篇关于如何改变一个.NET的DateTimePicker控件允许输入空值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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