根据this post的说法,在.net 4中有一个单独的DatePicker控件。我已经尝试过了,我看不出有什么好方法可以让它选择一天中的时间。
有没有一种简单的方法可以通过编辑XAML模板将DatePicker转换成DateTimePicker?如果不是,获得WPF4.0的DateTimePicker的最好方法是什么?
发布于 2012-05-19 03:37:37
Extended WPF Toolkit推出了一款很棒的带有时间的DateTimePicker。
在CP上还有一篇文章,其中有人创建了一个类似Winforms的控件……A WPF DateTimePicker That Works Like the One in Winforms
发布于 2012-05-19 03:32:57
没有一个没有自己制作或使用第三方控制。然而,如果你想要一个不支持数据绑定的快速修复,winforms中有一个...
xmlns:window="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
<window:WindowsFormsHost >
<wf:DateTimePicker Format="Time" ></wf:DateTimePicker>
</window:WindowsFormsHost>
只是一个时间选择器,但可以很容易地与日期选择器配对。您还需要引用WindowsFormsIntegration和System.Windows.Forms。
发布于 2012-05-19 03:36:00
在扩展的WPF工具包中尝试DateTimePicker。
https://stackoverflow.com/questions/10658472
复制相似问题