WPF Datepicker 控件无选项(WPF ToolKit)
如何在日期选择器控件中提供选择无日期(无)的选项?
请帮忙!!
谢谢 萨拉特
How to provide an option to select No dates(None) in datepicker control?
Please help!!
Thanks
Sharath
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
现在,我已经实际安装了WPF工具包并尝试了...
我发现,如果您手动删除日期选择器的文本框部分中的文本,则实际上会删除
SelectedDate
。或者,您可以添加一个直接删除SelectedDate
的按钮。WPF 代码:
代码隐藏 (VB):
如果您希望今天的日期不突出显示为灰色,可以将
IsTodayHighlighted
设置为 false。但它仍然是“活动日期”,它是日期周围的一个可见框,有点像“光标”,如果您使用键盘上的箭头四处移动,它就是起点。这与
SelectedDate
不同,但当您开始移动所选日期时,会立即设置它。Now, I have actually installed the WPF Toolkit and tried it...
I found out that if you manually delete the text in the textbox part of the datepicker, then the
SelectedDate
is actually deleted. Optionally, you can add a button that deletes theSelectedDate
directly.WPF code:
Code behind (VB):
If you want the todays date not to be highlighted as grey, you can set
IsTodayHighlighted
to false.It is still the "active date" though, which is a visible box around a date that is kind of a "cursor" that is the start point if you move around with the arrows on the keybord. This is not the same as
SelectedDate
, but the selected date is set immediately when you start to move it around.