如何在vb.net中使用datetimepicker禁用将来的日期 [英] how to disable future dates using datetimepicker in vb.net

查看:91
本文介绍了如何在vb.net中使用datetimepicker禁用将来的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在datetimepicker中禁用将来的日期。



只能输入当前和过去的日期。今天的日期是7月19日,因此用户可以在7月19日或之前输入日期。从7月20日起,当7月20日到来时,所有日期按钮将被禁用



,然后可以选择它,并禁用下一个后续dtes。



任何人都可以帮我PLZ。



i将被强制提前。谢谢

how to disable future dates in datetimepicker.

only current and past dates can be entered. supose today date is 19th july, so user can enter date for either 19th july or before it. and from 20th july,all the date buttons will be disabled

again when 20th july comes, then it can be selected and the next subsequent dtes are disabled.

can anyone help me plz.

i will be obliged.thanks in advance

推荐答案

你应该检查..

http://social.msdn.microsoft.com/Forums/vstudio/en-US/ee9634f1-3081-4db2-a617- cb112240a4b6 / datetimepicker-disable-future-dates-is-it-possible [ ^ ]

http://stackove rflow.com/questions/5304365/vb-net-disable-weekends-and-future-calendar-dates/5304706#5304706 [ ^ ]

http://stackoverflow.com/questions/12961627/datetimepicker-validation [ ^ ]

http://www.daniweb.com/software-development/vbnet/threads/150191/disabling- date-before-date-of-datetimepicker-control [ ^ ]
You should check..
http://social.msdn.microsoft.com/Forums/vstudio/en-US/ee9634f1-3081-4db2-a617-cb112240a4b6/datetimepicker-disable-future-dates-is-it-possible[^]
http://stackoverflow.com/questions/5304365/vb-net-disable-weekends-and-future-calendar-dates/5304706#5304706[^]
http://stackoverflow.com/questions/12961627/datetimepicker-validation[^]
http://www.daniweb.com/software-development/vbnet/threads/150191/disabling-dates-before-current-date-of-a-datetimepicker-control[^]


您可以使用
DatePicker.Enddate=Date.Time.Now();





这是在C#..你可以到Vb.net我希望.. :))



This is in C#.. You can make it to Vb.net I hope.. :)


这篇关于如何在vb.net中使用datetimepicker禁用将来的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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