修复DatePicker的样式

修复DatePicker的样式

本文介绍了修复DatePicker的样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

DatePicker是WPF控件的一个糟糕示例.它具有非标准的边框,间距与TextBox不同,它具有附加的内部边框,具有非标准的悬停效果,并且图标与Windows 7中的新图标不同.

DatePicker is an awful example of a WPF control. It has a non-standard border, the spacings are different to a TextBox, it has an additional inner border with a non-standard hover effect, and a different icon than what seems to be new in Windows 7.

DatePicker的Windows窗体版本的行为与其他平台控件非常相似.

The Windows Forms version of a DatePicker behaves much more like any other platform control.

那么我该怎么做才能将WPF DatePicker集成到其环境中?有人为此修复样式吗?最好能无缝地适用于XP/7/8主题的东西.

So what can I do to make WPF DatePicker integrate in its environment? Does somebody have a style fix for it? Preferably something that works in XP/7/8 themes seamlessly.

如果文本输入区像在WinForms中那样被屏蔽,并且将支持向上/向下箭头键来操纵日期的每个部分,那也很好.

It would also be nice if the text input area was masked like in WinForms and would support the up/down arrow keys for manipulating each part of the date.

推荐答案

另一个选择是使用某些第三方控件. Extended WPF Toolkit带有DateTimePicker,用户可以使用按钮微调器增加或减少DateTime: https://wpftoolkit.codeplex.com/wikipage?title=DateTimePicker

The other option is to use some third-party control. The Extended WPF Toolkit comes with a DateTimePicker where the user can increment or decrement the DateTime using button spinners:https://wpftoolkit.codeplex.com/wikipage?title=DateTimePicker

DevExpress还提供了一个自定义的DatePicker控件:https://www.devexpress.com/Products/NET/Controls/WPF/Editors/date-picker.xml

DevExpress also provides a custom DatePicker control: https://www.devexpress.com/Products/NET/Controls/WPF/Editors/date-picker.xml


这篇关于修复DatePicker的样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 17:55