的DateTimePicker能够选择一周的某些天 [英] DateTimePicker Ability to choose only certain days of the week

查看:124
本文介绍了的DateTimePicker能够选择一周的某些天的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要能够从的DateTimePicker选择一周的某些天。我想知道是否有可能迫使用户选择从周一至周五的任何一天,只是禁用SAT&放大器;太阳。我可以理解,我可以创造pre-评选活动,将弹出一个消息,要求用户重新选择他们的日子。我想看看是否有办法自动关闭SAT&放大器; SUN,只是有用户只选择周一至周五的任何一天。

I need to be able to choose only certain days of the week from DateTimePicker. I would like to know if it's possible to force the user to choose any day from MON-FRI, and just disable the SAT & SUN. I can understand that I can create pre-selection events that would pop-up a message asking user to re-select their days. I wanted to see if there is way to automatically disable the SAT & SUN and just have the user only select any day from MON-FRI.

推荐答案

有没有内置的功能,为的DateTimePicker限制日期之外能够选择的日期选取器开始和结束。 (IE浏览器,你不能阻挡日期落在内部的范围内。)

There's no built-in functionality for the DateTimePicker to limit dates outside of being able to choose when the date picker starts and ends. (IE, you can't block out dates that fall "inside" that range.)

相反,你要么需要使用另一种(和一些免费使用的那些确实存在),或者检查验证事件的日期,如果按照你的约会规则是无效的,重设日期和present错误。

Instead, you'll either need to use an alternative (and some free-to-use ones do exist) or check the date on the Validate event and if it's invalid according to your date rules, reset the date and present an error.

这篇关于的DateTimePicker能够选择一周的某些天的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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